Compare commits

...

39 Commits

Author SHA1 Message Date
Developer 02
1b21ccecf3 feat(DIExtensions): Methoden zur Injektion von Workflow-Diensten und mit TryAddScoped-Methode erstellt.
- Umwandlung von AddScoped in TryAddScoped in der Methode AddWorkFlowRepositories.
 - Methode mit dem Namen AddWorkFlow erstellt, um Dienste und Repositories zusammen hinzuzufügen
2024-10-23 17:42:19 +02:00
Developer 02
56344afdc8 feat(Anwendung): Crud-Dienste für Config, ProfileControlsTF, ProfileObjState, Profile und State erstellt.
- Implementierte zugehörige Schnittstellen.
2024-10-23 17:27:00 +02:00
Developer 02
dbbe07405b feat(Application): Crud-Service-Schnittstellen für Config, ProfileControlsTF, ProfileObjState, Profile und State erstellt.
- IUnique-Schnittstellen für ProfileControlsTFUpdateDto, ProfileObjStateUpdateDto und StateUpdateDto implementiert.
2024-10-23 17:04:36 +02:00
Developer 02
908dd6f170 feat(BaseUpdateDto): Implementierte IUniqe-Schnittstelle 2024-10-23 16:47:40 +02:00
Developer 02
dfb3dc3d08 feat: Profil von Auto-Mapper erstellt. 2024-10-23 16:42:19 +02:00
Developer 02
9f175bc4e9 feat(State): Erstellen, Lesen und Aktualisieren von DTOs unter Verwendung von Basis-DTOs zum Aktualisieren und Erstellen. 2024-10-23 16:32:58 +02:00
Developer 02
1453f9adb1 feat(ProfileObjState: Erstellen, Lesen und Aktualisieren von DTOs unter Verwendung von Basis-DTOs zum Aktualisieren und Erstellen. 2024-10-23 16:32:39 +02:00
Developer 02
21956cfc16 feat(ProfileControlsTF): Erstellen, Lesen und Aktualisieren von DTOs unter Verwendung von Basis-DTOs zum Aktualisieren und Erstellen. 2024-10-23 15:45:29 +02:00
Developer 02
1e6d247817 feat(Profile): Erstellen, Lesen und Aktualisieren von DTOs unter Verwendung von Basis-DTOs zum Aktualisieren und Erstellen. 2024-10-23 15:10:37 +02:00
Developer 02
adc33bfee1 feat(Config): Erstellen, Lesen und Aktualisieren von DTOs unter Verwendung von Basis-DTOs zum Aktualisieren und Erstellen. 2024-10-23 14:57:15 +02:00
Developer 02
5ce6958122 feat: BaseUpdateDto zur Verfolgung von Aktualisierungen hinzufügen
- BaseUpdateDto eingeführt, um Metadaten zur Aktualisierung zu kapseln.
- Eigenschaften umfassen ChangedWho und ChangedWhen, beide mit JsonIgnore markiert, um von der Serialisierung ausgeschlossen zu werden.
2024-10-23 14:36:23 +02:00
Developer 02
23e2267d00 feat: BaseCreateDto zur Verfolgung von Erstellung hinzufügen
- BaseCreateDto eingeführt, um Metadaten zur Erstellung zu kapseln.
- Eigenschaften umfassen AddedWho und AddedWhen, beide mit JsonIgnore markiert, um von der Serialisierung ausgeschlossen zu werden.
2024-10-23 14:34:52 +02:00
Developer 02
bc9ac273ea feat: Initalisiertes WorkFlow.Application Projekt mit Abhängigkeiten. 2024-10-23 14:19:55 +02:00
Developer 02
b0896c214f feat: Überladungen der Read-Methode für ProfileObjStateRepository hinzufügen
- Überladene ReadAsync-Methoden in ProfileObjStateRepository implementiert, um Filterung nach Benutzer und Status zu ermöglichen.
- Die Abfrageeffizienz durch Einbeziehung verwandter Entitäten und Anwendung bedingter Filter verbessert.
2024-10-23 14:12:04 +02:00
Developer 02
e1f0d611e5 ProfileObjStateRepository mit Read-Methode erweitern
- Neue Read-Methode zur ProfileObjStateRepository hinzugefügt, um flexiblere Abfragen zu ermöglichen.
- Die Methode unterstützt optionale Parameter zur Filterung nach Profil, Benutzer, Zustand und Objekt-ID.
- Verbesserte Datenabrufmöglichkeiten durch Einbeziehung verwandter Entitäten wie Profil und Zustand.
2024-10-23 14:00:55 +02:00
Developer 02
8ff6bbf93f refactor(ProfileObjState): Benutzer-Eigenschaft hinzugefügt, abhängig von Fremdschlüssel UsrId 2024-10-23 13:51:17 +02:00
Developer 02
650b23def9 refactor(ProfileControlsTFRepository): Überschriebene ReadOnly-Methode, um Profile und ProfileObjState Entitäten standardmäßig einzuschließen. 2024-10-23 13:40:12 +02:00
Developer 02
859f0631f0 refactor(repository): ReadAsync-Methode aktualisieren, um readonly-Parameter zu unterstützen 2024-10-23 13:36:50 +02:00
Developer 02
31bf58919d refactor(ProfileControlsTFRepository): Überschriebene ReadOnly-Methode, um Profile und User Entitäten standardmäßig einzuschließen. 2024-10-23 13:25:57 +02:00
Developer 02
480dcce051 feat(repository): Überladung der ReadAsync-Methode mit Username- und usrId-Filter in ProfileControlsTFRepository hinzugefügt
- Überladung von `ReadAsync` hinzugefügt, um die Filterung nach `usrId` und `username` zu unterstützen.
- `ReadAsync` aktualisiert, um die Einzelabfrage mit `FirstOrDefaultAsync` zu ermöglichen.
- Abfrageflexibilität verbessert, indem Benutzer- und Profilfilter in beiden asynchronen Methoden zugelassen werden.
2024-10-23 13:19:31 +02:00
Developer 02
e0877f5990 feat(repository): Async-Read-Methode und Username-Filter in ProfileControlsTFRepository hinzugefügt
- `ReadAsync`-Methode für asynchrone Abfrageausführung hinzugefügt.
- `username`-Filter zur `Read`-Methode hinzugefügt.
- Filterlogik in der `Read`-Methode aktualisiert, um die `username`-Bedingung einzuschließen.
2024-10-23 13:11:27 +02:00
Developer 02
845f7fe729 feat(repository): Abfragefunktionalität mit Filtern in ProfileControlsTFRepository hinzugefügt
- Methode `Read` mit optionalen Filtern für `Profile`, `User`, `profileId`, `usrId`, `objId` und `profileActive` in `ProfileControlsTFRepository` hinzugefügt.
- `AsNoTracking` für schreibgeschützte Abfragen eingeführt.
- `Include` für verwandte `Profile` und `User` Entitäten in der Abfrage hinzugefügt.
2024-10-23 13:02:11 +02:00
Developer 02
a7081d3f74 feat(WfState): Wf-Präfix aus Entität, Repository und DbSet entfernt 2024-10-23 11:49:20 +02:00
Developer 02
e1ec8c581c feat(ProfileObjState.cs): Mwf-Präfix entfernt 2024-10-23 11:47:14 +02:00
Developer 02
c76f9d1709 feat(ProfControlsTf.cs): Umbenennung der Domäne, des Repository und des dbset in ProfileControlsTF 2024-10-23 11:44:11 +02:00
Developer 02
4bcac51473 feat(ProfControlsTf.cs): Removed the Mwf prefix from property names. 2024-10-23 11:28:27 +02:00
Developer 02
1f4c7589d0 feat(Config.cs): Umbenennung von ConfTitle in Title und ConfString in String 2024-10-23 11:25:39 +02:00
Developer 02
8290699b2f feat(Infrastructure): erstellt DIExtensions.
- AddWorkFlowRepositories-Methode hinzugefügt, um Repositories über Schnittstellen einzubinden
2024-10-23 11:11:09 +02:00
Developer 02
f611847e2a feat(Contracts): implementiert alle Repository-Schnittstellen mit CRUDRepository 2024-10-23 11:07:37 +02:00
Developer 02
3c5df5bc6a feat(Contracts): IWfStateRepository als eine Implementierung von ICRUDRepository erstellt. 2024-10-23 10:45:01 +02:00
Developer 02
3f70bdc8f7 feat(Contracts): IProfileObjStateRepository als eine Implementierung von ICRUDRepository erstellt. 2024-10-23 10:44:05 +02:00
Developer 02
f0b182fb94 feat(Contracts): IProfileRepository als eine Implementierung von ICRUDRepository erstellt 2024-10-23 10:42:46 +02:00
Developer 02
3d35c1ab21 feat(Contracts): IProfControlsTfRepository als eine Implementierung von ICRUDRepository erstellt 2024-10-23 10:41:25 +02:00
Developer 02
16f694eb67 feat(Contracts): IConfigRepository als eine Implementierung von ICRUDRepository erstellt 2024-10-23 10:39:52 +02:00
Developer 02
5dab28d99d feat(Entitäten): IUnique-Schnittstelle, die auf jede Entität angewendet wird. 2024-10-23 10:35:33 +02:00
Developer 02
1df7858423 refactor(ProfileObjState): Umbenennen der Eigenschaft 'Profile' in 'MwfProfile' 2024-10-23 10:31:34 +02:00
Developer 02
cb5a6afde0 feat(ProfileObjState): State Entität mit StateId-foreign-key hinzugefügt. 2024-10-23 10:26:50 +02:00
Developer 02
d4d6c29225 feat(ProfileObjState): Profil Entität mit MwfProfileId-foreign-key hinzugefügt. 2024-10-23 10:26:15 +02:00
Developer 02
dd15b520c1 feat(ProfControlsTf): User Entität mit UsrId-foreign-key hinzugefügt.
- UserManager.Domain baget-package hinzugefügt
2024-10-23 10:20:59 +02:00
49 changed files with 632 additions and 19 deletions

View File

@@ -0,0 +1,10 @@
using DigitalData.Core.Abstractions.Application;
using WorkFlow.Application.DTO.Config;
using WorkFlow.Domain.Entities;
namespace WorkFlow.Application.Contracts
{
public interface IConfigService : ICRUDService<ConfigCreateDto, ConfigDto, ConfigUpdateDto, Config, int>
{
}
}

View File

@@ -0,0 +1,10 @@
using DigitalData.Core.Abstractions.Application;
using WorkFlow.Application.DTO.ProfileControlsTF;
using WorkFlow.Domain.Entities;
namespace WorkFlow.Application.Contracts
{
public interface IProfileControlsTFService : ICRUDService<ProfileControlsTFCreateDto, ProfileControlsTFDto, ProfileControlsTFUpdateDto, ProfileControlsTF, int>
{
}
}

View File

@@ -0,0 +1,10 @@
using DigitalData.Core.Abstractions.Application;
using WorkFlow.Application.DTO.ProfileObjState;
using WorkFlow.Domain.Entities;
namespace WorkFlow.Application.Contracts
{
public interface IProfileObjStateService : ICRUDService<ProfileObjStateCreateDto, ProfileObjStateDto, ProfileObjStateUpdateDto, ProfileObjState, int>
{
}
}

View File

@@ -0,0 +1,10 @@
using DigitalData.Core.Abstractions.Application;
using WorkFlow.Application.DTO.Profile;
using WorkFlow.Domain.Entities;
namespace WorkFlow.Application.Contracts
{
public interface IProfileService : ICRUDService<ProfileCreateDto, ProfileDto, ProfileUpdateDto, Profile, int>
{
}
}

View File

@@ -0,0 +1,10 @@
using DigitalData.Core.Abstractions.Application;
using WorkFlow.Application.DTO.State;
using WorkFlow.Domain.Entities;
namespace WorkFlow.Application.Contracts
{
public interface IStateService : ICRUDService<StateCreateDto, StateDto, StateUpdateDto, State, int>
{
}
}

View File

@@ -0,0 +1,25 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using WorkFlow.Application.Contracts;
using WorkFlow.Application.Services;
using WorkFlow.Infrastructure;
namespace WorkFlow.Application
{
public static class DIExtensions
{
public static IServiceCollection AddWorkFlowServices(this IServiceCollection services)
{
services.AddAutoMapper(typeof(MappingProfile).Assembly);
services.TryAddScoped<IConfigService, ConfigService>();
services.TryAddScoped<IProfileControlsTFService, ProfileControlsTFService>();
services.TryAddScoped<IProfileObjStateService, ProfileObjStateService>();
services.TryAddScoped<IProfileService, ProfileService>();
services.TryAddScoped<IStateService, StateService>();
return services;
}
public static IServiceCollection AddWorkFlow(this IServiceCollection services) => services.AddWorkFlowRepositories().AddWorkFlowServices();
}
}

View File

@@ -0,0 +1,13 @@
using System.Text.Json.Serialization;
namespace WorkFlow.Application.DTO
{
public record BaseCreateDto
{
[JsonIgnore]
public required string AddedWho { get; set; } = "UNKNOWN";
[JsonIgnore]
public required DateTime AddedWhen = DateTime.Now;
}
}

View File

@@ -0,0 +1,16 @@
using DigitalData.Core.Abstractions;
using System.Text.Json.Serialization;
namespace WorkFlow.Application.DTO
{
public record BaseUpdateDto : IUnique<int>
{
public required int Id { get; init; }
[JsonIgnore]
public required string ChangedWho { get; set; } = "UNKNOWN";
[JsonIgnore]
public required DateTime ChangedWhen = DateTime.Now;
}
}

View File

@@ -0,0 +1,4 @@
namespace WorkFlow.Application.DTO.Config
{
public record ConfigCreateDto(string Title, string String);
}

View File

@@ -0,0 +1,10 @@
namespace WorkFlow.Application.DTO.Config
{
public record ConfigDto(int Id,
string Title,
string String,
string AddedWho,
DateTime AddedWhen,
string? ChangedWho = null,
DateTime? ChangedWhen = null);
}

View File

@@ -0,0 +1,4 @@
namespace WorkFlow.Application.DTO.Config
{
public record ConfigUpdateDto(string Title, string String) : BaseUpdateDto;
}

View File

@@ -0,0 +1,4 @@
namespace WorkFlow.Application.DTO.Profile
{
public record ProfileCreateDto(string IntlName, int ExtId1, bool Active, byte TypeId) : BaseCreateDto;
}

View File

@@ -0,0 +1,12 @@
namespace WorkFlow.Application.DTO.Profile
{
public record ProfileDto(int Id,
string IntlName,
int ExtId1,
bool Active,
byte TypeId,
string AddedWho,
DateTime AddedWhen,
string? ChangedWho = null,
DateTime? ChangedWhen = null);
}

View File

@@ -0,0 +1,4 @@
namespace WorkFlow.Application.DTO.Profile
{
public record ProfileUpdateDto(string IntlName, int ExtId1, bool Active, byte TypeId) : BaseUpdateDto;
}

View File

@@ -0,0 +1,14 @@
namespace WorkFlow.Application.DTO.ProfileControlsTF
{
public record ProfileControlsTFCreateDto(int Id,
int ProfileId,
int UsrId,
long ObjId,
string ObjType,
string AttrName,
string CtrlType,
string CtrlCaption,
bool Mandatory,
bool ReadOnly,
string? ChoiceList = null) : BaseCreateDto;
}

View File

@@ -0,0 +1,21 @@
using DigitalData.UserManager.Application.DTOs.User;
using WorkFlow.Application.DTO.Profile;
namespace WorkFlow.Application.DTO.ProfileControlsTF
{
public record ProfileControlsTFDto(int Id,
int ProfileId,
int UsrId,
long ObjId,
string ObjType,
string AttrName,
string CtrlType,
string CtrlCaption,
bool Mandatory,
bool ReadOnly,
string AddedWho,
DateTime AddedWhen,
string? ChoiceList = null,
ProfileDto? Profile = null,
UserReadDto? User = null);
}

View File

@@ -0,0 +1,9 @@
using DigitalData.Core.Abstractions;
namespace WorkFlow.Application.DTO.ProfileControlsTF
{
/// <summary>
/// This Data Transfer Object (DTO) serves as a placeholder and does not support updates.
/// </summary>
public record ProfileControlsTFUpdateDto(int Id) : IUnique<int>;
}

View File

@@ -0,0 +1,11 @@
namespace WorkFlow.Application.DTO.ProfileObjState
{
public record ProfileObjStateCreateDto(
int ProfileId,
int UsrId,
long ObjId,
int StateId,
string? State2 = null,
string? State3 = null,
string? State4 = null) : BaseCreateDto;
}

View File

@@ -0,0 +1,20 @@
using DigitalData.UserManager.Application.DTOs.User;
using WorkFlow.Application.DTO.Profile;
using WorkFlow.Application.DTO.State;
namespace WorkFlow.Application.DTO.ProfileObjState
{
public record ProfileObjStateDto(int Id,
int ProfileId,
int UsrId,
long ObjId,
int StateId,
string AddedWho,
DateTime AddedWhen,
string? State2 = null,
string? State3 = null,
string? State4 = null,
ProfileDto? Profile = null,
UserReadDto? User = null,
StateDto? State = null);
}

View File

@@ -0,0 +1,9 @@
using DigitalData.Core.Abstractions;
namespace WorkFlow.Application.DTO.ProfileObjState
{
/// <summary>
/// This Data Transfer Object (DTO) serves as a placeholder and does not support updates.
/// </summary>
public record ProfileObjStateUpdateDto(int Id) : IUnique<int>;
}

View File

@@ -0,0 +1,4 @@
namespace WorkFlow.Application.DTO.State
{
public record StateCreateDto(string IntlState) : BaseCreateDto;
}

View File

@@ -0,0 +1,4 @@
namespace WorkFlow.Application.DTO.State
{
public record StateDto(int Id, string IntlState, string AddedWho, DateTime AddedWhen);
}

View File

@@ -0,0 +1,9 @@
using DigitalData.Core.Abstractions;
namespace WorkFlow.Application.DTO.State
{
/// <summary>
/// This Data Transfer Object (DTO) serves as a placeholder and does not support updates.
/// </summary>
public record StateUpdateDto(int Id) : IUnique<int>;
}

View File

@@ -0,0 +1,37 @@
using AutoMapper;
using WorkFlow.Application.DTO.Config;
using WorkFlow.Application.DTO.Profile;
using WorkFlow.Application.DTO.ProfileControlsTF;
using WorkFlow.Application.DTO.ProfileObjState;
using WorkFlow.Application.DTO.State;
using WorkFlow.Domain.Entities;
namespace WorkFlow.Application
{
public class MappingProfile : AutoMapper.Profile
{
public MappingProfile()
{
// Mapping entity to DTO
CreateMap<Config, ConfigDto>();
CreateMap<Domain.Entities.Profile, ProfileDto>();
CreateMap<ProfileControlsTF, ProfileControlsTFDto>();
CreateMap<ProfileObjState, ProfileObjStateDto>();
CreateMap<State, StateDto>();
// Mapping create-DTO to entity
CreateMap<ConfigCreateDto, Config>();
CreateMap<ProfileCreateDto, Domain.Entities.Profile>();
CreateMap<ProfileControlsTFCreateDto, ProfileControlsTF>();
CreateMap<ProfileObjStateCreateDto, ProfileObjState>();
CreateMap<StateCreateDto, State>();
// Mapping update-DTO to entity
CreateMap<ConfigUpdateDto, Config>();
CreateMap<ProfileUpdateDto, Domain.Entities.Profile>();
CreateMap<ProfileControlsTFUpdateDto, ProfileControlsTF>();
CreateMap<ProfileObjStateUpdateDto, ProfileObjState>();
CreateMap<StateUpdateDto, State>();
}
}
}

View File

@@ -0,0 +1,16 @@
using AutoMapper;
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.Application;
using WorkFlow.Application.Contracts;
using WorkFlow.Application.DTO.Config;
using WorkFlow.Domain.Entities;
using WorkFlow.Infrastructure.Contracts;
namespace WorkFlow.Application.Services
{
public class ConfigService(IConfigRepository repository, IMapper mapper)
: CRUDService<IConfigRepository, ConfigCreateDto, ConfigDto, ConfigUpdateDto, Config, int>(repository, mapper),
IConfigService, ICRUDService<ConfigCreateDto, ConfigDto, ConfigUpdateDto, Config, int>
{
}
}

View File

@@ -0,0 +1,16 @@
using AutoMapper;
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.Application;
using WorkFlow.Application.Contracts;
using WorkFlow.Application.DTO.ProfileControlsTF;
using WorkFlow.Domain.Entities;
using WorkFlow.Infrastructure.Repositories;
namespace WorkFlow.Application.Services
{
public class ProfileControlsTFService(ProfileControlsTFRepository repository, IMapper mapper)
: CRUDService<ProfileControlsTFRepository, ProfileControlsTFCreateDto, ProfileControlsTFDto, ProfileControlsTFUpdateDto, ProfileControlsTF, int>(repository, mapper),
IProfileControlsTFService, ICRUDService<ProfileControlsTFCreateDto, ProfileControlsTFDto, ProfileControlsTFUpdateDto, ProfileControlsTF, int>
{
}
}

View File

@@ -0,0 +1,16 @@
using AutoMapper;
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.Application;
using WorkFlow.Application.Contracts;
using WorkFlow.Application.DTO.ProfileObjState;
using WorkFlow.Domain.Entities;
using WorkFlow.Infrastructure.Contracts;
namespace WorkFlow.Application.Services
{
public class ProfileObjStateService(IProfileObjStateRepository repository, IMapper mapper)
: CRUDService<IProfileObjStateRepository, ProfileObjStateCreateDto, ProfileObjStateDto, ProfileObjStateUpdateDto, ProfileObjState, int>(repository, mapper),
IProfileObjStateService, ICRUDService<ProfileObjStateCreateDto, ProfileObjStateDto, ProfileObjStateUpdateDto, ProfileObjState, int>
{
}
}

View File

@@ -0,0 +1,15 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.Application;
using WorkFlow.Application.Contracts;
using WorkFlow.Application.DTO.Profile;
using WorkFlow.Domain.Entities;
using WorkFlow.Infrastructure.Contracts;
namespace WorkFlow.Application.Services
{
public class ProfileService(IProfileRepository repository, AutoMapper.IMapper mapper)
: CRUDService<IProfileRepository, ProfileCreateDto, ProfileDto, ProfileUpdateDto, Profile, int>(repository, mapper),
IProfileService, ICRUDService<ProfileCreateDto, ProfileDto, ProfileUpdateDto, Profile, int>
{
}
}

View File

@@ -0,0 +1,16 @@
using AutoMapper;
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.Application;
using WorkFlow.Application.Contracts;
using WorkFlow.Application.DTO.State;
using WorkFlow.Domain.Entities;
using WorkFlow.Infrastructure.Contracts;
namespace WorkFlow.Application.Services
{
public class StateService(IStateRepository repository, IMapper mapper)
: CRUDService<IStateRepository, StateCreateDto, StateDto, StateUpdateDto, State, int>(repository, mapper),
IStateService, ICRUDService<StateCreateDto, StateDto, StateUpdateDto, State, int>
{
}
}

View File

@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DigitalData.Core.Application" Version="2.0.0" />
<PackageReference Include="UserManager.Application" Version="2.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WorkFlow.Domain\WorkFlow.Domain.csproj" />
<ProjectReference Include="..\WorkFlow.Infrastructure\WorkFlow.Infrastructure.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,10 +1,11 @@
using System.ComponentModel.DataAnnotations;
using DigitalData.Core.Abstractions;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace WorkFlow.Domain.Entities
{
[Table("TBMWF_CONFIG", Schema = "dbo")]
public class Config
public class Config : IUnique<int>
{
[Key]
[Column("GUID")]
@@ -12,11 +13,11 @@ namespace WorkFlow.Domain.Entities
[Required]
[Column("CONF_TITLE", TypeName = "varchar(100)")]
public required string ConfTitle { get; init; }
public required string Title { get; init; }
[Required]
[Column("CONF_STRING", TypeName = "varchar(900)")]
public required string ConfString { get; init; }
public required string String { get; init; }
[Required]
[Column("ADDED_WHO", TypeName = "varchar(30)")]

View File

@@ -1,10 +1,11 @@
using System.ComponentModel.DataAnnotations;
using DigitalData.Core.Abstractions;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace WorkFlow.Domain.Entities
{
[Table("TBMWF_PROFILE", Schema = "dbo")]
public class Profile
public class Profile : IUnique<int>
{
[Key]
[Column("GUID")]

View File

@@ -1,10 +1,12 @@
using System.ComponentModel.DataAnnotations;
using DigitalData.Core.Abstractions;
using DigitalData.UserManager.Domain.Entities;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace WorkFlow.Domain.Entities
{
[Table("TBMWF_PROF_CONTROLS_TF", Schema = "dbo")]
public class ProfControlsTf
public class ProfileControlsTF : IUnique<int>
{
[Key]
[Column("GUID")]
@@ -12,7 +14,7 @@ namespace WorkFlow.Domain.Entities
[Required]
[Column("MWF_PROFILE_ID")]
public required int MwfProfileId { get; init; }
public required int ProfileId { get; init; }
[Required]
[Column("USR_ID")]
@@ -57,7 +59,10 @@ namespace WorkFlow.Domain.Entities
[Column("ADDED_WHEN", TypeName = "datetime")]
public required DateTime AddedWhen { get; init; }
[ForeignKey("MwfProfileId")]
public Profile? MwfProfile { get; init; } = default;
[ForeignKey("ProfileId")]
public Profile? Profile { get; init; } = default;
[ForeignKey("UsrId")]
public User? User { get; set; } = default;
}
}

View File

@@ -1,10 +1,12 @@
using System.ComponentModel.DataAnnotations;
using DigitalData.Core.Abstractions;
using DigitalData.UserManager.Domain.Entities;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace WorkFlow.Domain.Entities
{
[Table("TBMWF_PROFILE_OBJ_STATE", Schema = "dbo")]
public class ProfileObjState
public class ProfileObjState : IUnique<int>
{
[Key]
[Column("GUID")]
@@ -12,7 +14,7 @@ namespace WorkFlow.Domain.Entities
[Required]
[Column("MWF_PROFILE_ID")]
public required int MwfProfileId { get; init; }
public required int ProfileId { get; init; }
[Required]
[Column("USR_ID")]
@@ -42,5 +44,14 @@ namespace WorkFlow.Domain.Entities
[Required]
[Column("ADDED_WHEN", TypeName = "datetime")]
public required DateTime AddedWhen { get; init; }
[ForeignKey("ProfileId")]
public Profile? Profile { get; init; } = null;
[ForeignKey("UsrId")]
public User? User { get; init; } = null;
[ForeignKey("StateId")]
public State? State { get; init; } = null;
}
}

View File

@@ -1,10 +1,11 @@
using System.ComponentModel.DataAnnotations;
using DigitalData.Core.Abstractions;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace WorkFlow.Domain.Entities
{
[Table("TBMWF_WF_STATE", Schema = "dbo")]
public class WfState
public class State : IUnique<int>
{
[Key]
[Column("GUID")]

View File

@@ -6,4 +6,8 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="UserManager.Domain" Version="2.0.0" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,9 @@
using DigitalData.Core.Abstractions.Infrastructure;
using WorkFlow.Domain.Entities;
namespace WorkFlow.Infrastructure.Contracts
{
public interface IConfigRepository : ICRUDRepository<Config, int>
{
}
}

View File

@@ -0,0 +1,12 @@
using DigitalData.Core.Abstractions.Infrastructure;
using WorkFlow.Domain.Entities;
namespace WorkFlow.Infrastructure.Contracts
{
public interface IProfileControlsTFRepository : ICRUDRepository<ProfileControlsTF, int>
{
Task<IEnumerable<ProfileControlsTF>> ReadAsync(bool isReadonly = true, bool withProfile = true, bool withUser = false, int? profileId = null, int? objId = null, bool? profileActive = null);
Task<ProfileControlsTF?> ReadAsync(bool isReadonly = true, bool withProfile = true, bool withUser = false, int? usrId = null, string? username = null, int? profileId = null, int? objId = null, bool? profileActive = null);
}
}

View File

@@ -0,0 +1,12 @@
using DigitalData.Core.Abstractions.Infrastructure;
using WorkFlow.Domain.Entities;
namespace WorkFlow.Infrastructure.Contracts
{
public interface IProfileObjStateRepository : ICRUDRepository<ProfileObjState, int>
{
Task<IEnumerable<ProfileObjState>> ReadAsync(bool isReadonly = true, bool withProfile = true, bool withUser = true, bool withState = true, int? profileId = null, int? objId = null, bool? profileActive = null);
Task<ProfileObjState?> ReadAsync(bool isReadonly = true, bool withProfile = true, bool withUser = false, bool withState = true, int? usrId = null, string? username = null, int? profileId = null, int? objId = null, bool? profileActive = null);
}
}

View File

@@ -0,0 +1,9 @@
using DigitalData.Core.Abstractions.Infrastructure;
using WorkFlow.Domain.Entities;
namespace WorkFlow.Infrastructure.Contracts
{
public interface IProfileRepository : ICRUDRepository<Profile, int>
{
}
}

View File

@@ -0,0 +1,9 @@
using DigitalData.Core.Abstractions.Infrastructure;
using WorkFlow.Domain.Entities;
namespace WorkFlow.Infrastructure.Contracts
{
public interface IStateRepository : ICRUDRepository<State, int>
{
}
}

View File

@@ -0,0 +1,21 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using WorkFlow.Infrastructure.Contracts;
using WorkFlow.Infrastructure.Repositories;
namespace WorkFlow.Infrastructure
{
public static class DIExtensions
{
public static IServiceCollection AddWorkFlowRepositories(this IServiceCollection services)
{
services.TryAddScoped<IConfigRepository, ConfigRepository>();
services.TryAddScoped<IProfileControlsTFRepository, ProfileControlsTFRepository>();
services.TryAddScoped<IProfileObjStateRepository, ProfileObjStateRepository>();
services.TryAddScoped<IProfileRepository, ProfileRepository>();
services.TryAddScoped<IStateRepository, StateRepository>();
return services;
}
}
}

View File

@@ -0,0 +1,11 @@
using DigitalData.Core.Abstractions.Infrastructure;
using DigitalData.Core.Infrastructure;
using WorkFlow.Domain.Entities;
using WorkFlow.Infrastructure.Contracts;
namespace WorkFlow.Infrastructure.Repositories
{
public class ConfigRepository(WFDBContext dbContext) : CRUDRepository<Config, int, WFDBContext>(dbContext, dbContext.Configs), IConfigRepository, ICRUDRepository<Config, int>
{
}
}

View File

@@ -0,0 +1,48 @@
using DigitalData.Core.Abstractions.Infrastructure;
using DigitalData.Core.Infrastructure;
using Microsoft.EntityFrameworkCore;
using WorkFlow.Domain.Entities;
using WorkFlow.Infrastructure.Contracts;
namespace WorkFlow.Infrastructure.Repositories
{
public class ProfileControlsTFRepository(WFDBContext dbContext) : CRUDRepository<ProfileControlsTF, int, WFDBContext>(dbContext, dbContext.ProfileControlsTFs), IProfileControlsTFRepository, ICRUDRepository<ProfileControlsTF, int>
{
protected override IQueryable<ProfileControlsTF> ReadOnly() => base.ReadOnly().Include(pctf => pctf.Profile).Include(pctf => pctf.User);
protected IQueryable<ProfileControlsTF> Read(bool isReadonly = false, bool withProfile = true, bool withUser = true, int? profileId = null, int? usrId = null, string? username = null, int? objId = null, bool? profileActive = null)
{
var query = isReadonly ? _dbSet.AsNoTracking() : _dbSet.AsQueryable();
if (withProfile)
query = query.Include(pctf => pctf.Profile);
if (withUser)
query = query.Include(pctf => pctf.User);
if (profileId is not null)
query = query.Where(pctf => pctf.ProfileId == profileId);
if (usrId is not null)
query = query.Where(pctf => pctf.UsrId == usrId);
if (username is null)
query = query.Where(pctf => pctf.User!.Username == username);
if (objId is not null)
query = query.Where(pctf => pctf.ObjId == objId);
if (profileActive is not null)
query = query.Where(pctf => pctf.Profile!.Active == profileActive);
return query;
}
public async Task<IEnumerable<ProfileControlsTF>> ReadAsync(bool isReadonly = true, bool withProfile = true, bool withUser = true, int? profileId = null, int? objId = null, bool? profileActive = null)
=> await Read(isReadonly: isReadonly, withProfile: withProfile, withUser: withUser, profileId: profileId, objId: objId, profileActive: profileActive).ToListAsync();
public async Task<ProfileControlsTF?> ReadAsync(bool isReadonly = true, bool withProfile = true, bool withUser = false, int? usrId = null, string? username = null, int? profileId = null, int? objId = null, bool? profileActive = null)
=> await Read(isReadonly: isReadonly, withProfile: withProfile, withUser: withUser, usrId: usrId, username: username, profileId: profileId, objId: objId, profileActive: profileActive)
.FirstOrDefaultAsync();
}
}

View File

@@ -0,0 +1,54 @@
using DigitalData.Core.Abstractions.Infrastructure;
using DigitalData.Core.Infrastructure;
using Microsoft.EntityFrameworkCore;
using WorkFlow.Domain.Entities;
using WorkFlow.Infrastructure.Contracts;
namespace WorkFlow.Infrastructure.Repositories
{
public class ProfileObjStateRepository(WFDBContext dbContext) : CRUDRepository<ProfileObjState, int, WFDBContext>(dbContext, dbContext.ProfileObjStates), IProfileObjStateRepository, ICRUDRepository<ProfileObjState, int>
{
protected override IQueryable<ProfileObjState> ReadOnly() => base.ReadOnly().Include(pos => pos.Profile).Include(pos => pos.State);
protected IQueryable<ProfileObjState> Read(bool isReadonly = false, bool withProfile = true, bool withUser = true, bool withState = true, int? profileId = null, int? usrId = null, string? username = null, int? stateId = null, int? objId = null, bool? profileActive = null)
{
var query = isReadonly ? _dbSet.AsNoTracking() : _dbSet.AsQueryable();
if (withProfile)
query = query.Include(pctf => pctf.Profile);
if (withUser)
query = query.Include(pctf => pctf.User);
if (withState)
query = query.Include(pctf => pctf.State);
if (profileId is not null)
query = query.Where(pctf => pctf.ProfileId == profileId);
if (usrId is not null)
query = query.Where(pctf => pctf.UsrId == usrId);
if (username is null)
query = query.Where(pctf => pctf.User!.Username == username);
if (stateId is null)
query = query.Where(pctf => pctf.State!.Id == stateId);
if (objId is not null)
query = query.Where(pctf => pctf.ObjId == objId);
if (profileActive is not null)
query = query.Where(pctf => pctf.Profile!.Active == profileActive);
return query;
}
public async Task<IEnumerable<ProfileObjState>> ReadAsync(bool isReadonly = true, bool withProfile = true, bool withUser = true, bool withState = true, int? profileId = null, int? objId = null, bool? profileActive = null)
=> await Read(isReadonly: isReadonly, withProfile: withProfile, withUser: withUser, withState: withState, profileId: profileId, objId: objId, profileActive: profileActive).ToListAsync();
public async Task<ProfileObjState?> ReadAsync(bool isReadonly = true, bool withProfile = true, bool withUser = false, bool withState = true, int? usrId = null, string? username = null, int? profileId = null, int? objId = null, bool? profileActive = null)
=> await Read(isReadonly: isReadonly, withProfile: withProfile, withUser: withUser, withState: withState, usrId: usrId, username: username, profileId: profileId, objId: objId, profileActive: profileActive)
.FirstOrDefaultAsync();
}
}

View File

@@ -0,0 +1,11 @@
using DigitalData.Core.Abstractions.Infrastructure;
using DigitalData.Core.Infrastructure;
using WorkFlow.Domain.Entities;
using WorkFlow.Infrastructure.Contracts;
namespace WorkFlow.Infrastructure.Repositories
{
public class ProfileRepository(WFDBContext dbContext) : CRUDRepository<Profile, int, WFDBContext>(dbContext, dbContext.Profiles), IProfileRepository, ICRUDRepository<Profile, int>
{
}
}

View File

@@ -0,0 +1,10 @@
using DigitalData.Core.Abstractions.Infrastructure;
using DigitalData.Core.Infrastructure;
using WorkFlow.Domain.Entities;
using WorkFlow.Infrastructure.Contracts;
namespace WorkFlow.Infrastructure.Repositories
{
public class StateRepository(WFDBContext dbContext) : CRUDRepository<State, int, WFDBContext>(dbContext, dbContext.States), IStateRepository, ICRUDRepository<State, int>
{
}
}

View File

@@ -7,12 +7,12 @@ namespace WorkFlow.Infrastructure
{
public DbSet<Config> Configs { get; set; }
public DbSet<ProfControlsTf> ProfControlsTf { get; set; }
public DbSet<ProfileControlsTF> ProfileControlsTFs { get; set; }
public DbSet<Profile> Profiles { get; set; }
public DbSet<ProfileObjState> ProfileObjStates { get; set; }
public DbSet<WfState> WfStates { get; set; }
public DbSet<State> States { get; set; }
}
}

View File

@@ -5,7 +5,9 @@ VisualStudioVersion = 17.9.34622.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkFlow.Domain", "WorkFlow.Domain\WorkFlow.Domain.csproj", "{71E9264E-A2F0-4E5A-B010-8E4618C0C6AC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkFlow.Infrastructure", "WorkFlow.Infrastructure\WorkFlow.Infrastructure.csproj", "{62526D0D-3365-4113-854A-3656191D7C63}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkFlow.Infrastructure", "WorkFlow.Infrastructure\WorkFlow.Infrastructure.csproj", "{62526D0D-3365-4113-854A-3656191D7C63}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkFlow.Application", "WorkFlow.Application\WorkFlow.Application.csproj", "{5700B5DD-D17E-4E17-ADE5-48C95A0CC364}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -21,6 +23,10 @@ Global
{62526D0D-3365-4113-854A-3656191D7C63}.Debug|Any CPU.Build.0 = Debug|Any CPU
{62526D0D-3365-4113-854A-3656191D7C63}.Release|Any CPU.ActiveCfg = Release|Any CPU
{62526D0D-3365-4113-854A-3656191D7C63}.Release|Any CPU.Build.0 = Release|Any CPU
{5700B5DD-D17E-4E17-ADE5-48C95A0CC364}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5700B5DD-D17E-4E17-ADE5-48C95A0CC364}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5700B5DD-D17E-4E17-ADE5-48C95A0CC364}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5700B5DD-D17E-4E17-ADE5-48C95A0CC364}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE