From 6c0f39e3ed00f8b145b40e48f2ae29617a944d48 Mon Sep 17 00:00:00 2001 From: TekH Date: Wed, 30 Jul 2025 11:01:29 +0200 Subject: [PATCH] =?UTF-8?q?refactor(domain):=20Aktualisieren=20Sie=20die?= =?UTF-8?q?=20Entit=C3=A4t=20=E2=80=9EProfileControlsTF=E2=80=9C,=20damit?= =?UTF-8?q?=20sie=20dem=20neuen=20Schema=20entspricht=20-=20Die=20Implemen?= =?UTF-8?q?tierung=20von=20IUnique=20und=20zugeh=C3=B6rige=20Navigati?= =?UTF-8?q?onseigenschaften=20wurden=20entfernt=20-=20Der=20Prim=C3=A4rsch?= =?UTF-8?q?l=C3=BCsseltyp=20wurde=20von=20int=20zu=20long=20ge=C3=A4ndert?= =?UTF-8?q?=20-=20Die=20Spaltentypen=20und=20-namen=20wurden=20aktualisier?= =?UTF-8?q?t,=20um=20sie=20an=20das=20Datenbankschema=20anzupassen=20-=20E?= =?UTF-8?q?rforderliche=20Eigenschaften=20wurden=20in=20nullbare=20Typen?= =?UTF-8?q?=20mit=20Validierung=20auf=20Anwendungsebene=20konvertiert=20-?= =?UTF-8?q?=20XML-Kommentare=20wurden=20hinzugef=C3=BCgt,=20um=20Designent?= =?UTF-8?q?scheidungen=20hinsichtlich=20der=20Nullbarkeit=20zu=20verdeutli?= =?UTF-8?q?chen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/ProfileControlsTF.cs | 162 +++++++++++------- .../Entities/ProfileObjState.cs | 75 ++++---- 2 files changed, 135 insertions(+), 102 deletions(-) diff --git a/src/WorkFlow.Domain/Entities/ProfileControlsTF.cs b/src/WorkFlow.Domain/Entities/ProfileControlsTF.cs index b37a51b..60e95be 100644 --- a/src/WorkFlow.Domain/Entities/ProfileControlsTF.cs +++ b/src/WorkFlow.Domain/Entities/ProfileControlsTF.cs @@ -1,68 +1,102 @@ -using DigitalData.Core.Abstractions; -using DigitalData.UserManager.Domain.Entities; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace WorkFlow.Domain.Entities +namespace WorkFlow.Domain.Entities; + +[Table("TBMWF_PROF_CONTROLS_TF", Schema = "dbo")] +public class ProfileControlsTF { - [Table("TBMWF_PROF_CONTROLS_TF", Schema = "dbo")] - public class ProfileControlsTF : IUnique - { - [Key] - [Column("GUID")] - public int Id { get; init; } - - [Required] - [Column("MWF_PROFILE_ID")] - public required int ProfileId { get; init; } - - [Required] - [Column("USR_ID")] - public required int UserId { get; init; } - - [Required] - [Column("OBJ_ID")] - public required long ObjId { get; init; } - - [Required] - [Column("OBJ_TYPE", TypeName = "varchar(10)")] - public required string ObjType { get; init; } - - [Required] - [Column("ATTR_NAME", TypeName = "varchar(100)")] - public required string AttrName { get; init; } - - [Required] - [Column("CTRL_TYPE", TypeName = "varchar(10)")] - public required string CtrlType { get; init; } - - [Required] - [Column("CTRL_CAPTION", TypeName = "varchar(100)")] - public required string CtrlCaption { get; init; } - - [Required] - [Column("MANDATORY")] - public required bool Mandatory { get; init; } - - [Column("CHOICE_LIST", TypeName = "nvarchar(max)")] - public string? ChoiceList { get; init; } - - [Required] - [Column("READ_ONLY")] - public required bool ReadOnly { get; init; } - - [Required] - [Column("ADDED_WHO", TypeName = "varchar(100)")] - public required string AddedWho { get; init; } - - [Required] - [Column("ADDED_WHEN", TypeName = "datetime")] - public required DateTime AddedWhen { get; init; } - - [ForeignKey("ProfileId")] - public Profile? Profile { get; init; } = default; - - [ForeignKey("UserId")] - public User? User { get; set; } = default; - } + [Key] + [Column("GUID", TypeName = "bigint")] + public long Id { get; set; } + + /// + /// Although this field is marked as nullable in the database schema to allow + /// for greater flexibility during database-level operations or migrations, it is + /// treated as required and not null within the application logic. + /// Validation should be enforced at the application level to ensure a value is provided. + /// + [Column("OBJ_STATE_ID", TypeName = "bigint")] + public long? StateId { get; set; } + + /// + /// Although this field is marked as nullable in the database schema to allow + /// for greater flexibility during database-level operations or migrations, it is + /// treated as required and not null within the application logic. + /// Validation should be enforced at the application level to ensure a value is provided. + /// + [Column("DIALOG_NO", TypeName = "tinyint")] + public byte? DialogNo { get; set; } + + /// + /// Although this field is marked as nullable in the database schema to allow + /// for greater flexibility during database-level operations or migrations, it is + /// treated as required and not null within the application logic. + /// Validation should be enforced at the application level to ensure a value is provided. + /// + [Column("ATTR_NAME", TypeName = "nvarchar(100)")] + public string? AttrName { get; set; } + + /// + /// Although this field is marked as nullable in the database schema to allow + /// for greater flexibility during database-level operations or migrations, it is + /// treated as required and not null within the application logic. + /// Validation should be enforced at the application level to ensure a value is provided. + /// + [Column("CTRL_TYPE", TypeName = "nvarchar(10)")] + public string? CtrlType { get; set; } + + /// + /// Although this field is marked as nullable in the database schema to allow + /// for greater flexibility during database-level operations or migrations, it is + /// treated as required and not null within the application logic. + /// Validation should be enforced at the application level to ensure a value is provided. + /// + [Column("CAPTION", TypeName = "nvarchar(100)")] + public string? Caption { get; set; } + + /// + /// Although this field is marked as nullable in the database schema to allow + /// for greater flexibility during database-level operations or migrations, it is + /// treated as required and not null within the application logic. + /// Validation should be enforced at the application level to ensure a value is provided. + /// + [Column("TEXT", TypeName = "nvarchar(500)")] + public string? Text { get; set; } + + [Column("ICON", TypeName = "nvarchar(100)")] + public string? Icon { get; set; } + + /// + /// Although this field is marked as nullable in the database schema to allow + /// for greater flexibility during database-level operations or migrations, it is + /// treated as required and not null within the application logic. + /// Validation should be enforced at the application level to ensure a value is provided. + /// + [Column("MANDATORY", TypeName = "bit")] + public bool? Mandatory { get; set; } + + [Column("CHOICE_LIST", TypeName = "nvarchar(max)")] + public string? ChoiceList { get; set; } + + /// + /// Although this field is marked as nullable in the database schema to allow + /// for greater flexibility during database-level operations or migrations, it is + /// treated as required and not null within the application logic. + /// Validation should be enforced at the application level to ensure a value is provided. + /// + [Column("READ_ONLY", TypeName = "bit")] + public bool? ReadOnly { get; set; } + + [Column("SEQU", TypeName = "tinyint")] + public byte? Sequ { get; set; } = 0; + + [Column("ADDED_WHO", TypeName = "nvarchar(100)")] + public required string AddedWho { get; set; } + + [Column("ADDED_WHEN", TypeName = "datetime")] + public DateTime AddedWhen { get; set; } + + [ForeignKey("StateId")] + public virtual ProfileObjState? State { get; set; } } \ No newline at end of file diff --git a/src/WorkFlow.Domain/Entities/ProfileObjState.cs b/src/WorkFlow.Domain/Entities/ProfileObjState.cs index 8ecc4a9..c1d3006 100644 --- a/src/WorkFlow.Domain/Entities/ProfileObjState.cs +++ b/src/WorkFlow.Domain/Entities/ProfileObjState.cs @@ -3,55 +3,54 @@ using DigitalData.UserManager.Domain.Entities; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace WorkFlow.Domain.Entities +namespace WorkFlow.Domain.Entities; + +[Table("TBMWF_PROFILE_OBJ_STATE", Schema = "dbo")] +public class ProfileObjState : IUnique { - [Table("TBMWF_PROFILE_OBJ_STATE", Schema = "dbo")] - public class ProfileObjState : IUnique - { - [Key] - [Column("GUID")] - public int Id { get; init; } + [Key] + [Column("GUID")] + public long Id { get; init; } - [Required] - [Column("MWF_PROFILE_ID")] - public required int ProfileId { get; init; } + [Required] + [Column("MWF_PROFILE_ID")] + public required int ProfileId { get; init; } - [Required] - [Column("USR_ID")] - public required int UserId { get; init; } + [Required] + [Column("USR_ID")] + public required int UserId { get; init; } - [Required] - [Column("OBJ_ID")] - public required long ObjId { get; init; } + [Required] + [Column("OBJ_ID")] + public required long ObjId { get; init; } - [Required] - [Column("STATE_ID")] - public required int StateId { get; init; } + [Required] + [Column("STATE_ID")] + public required int StateId { get; init; } - [Column("STATE2", TypeName = "nvarchar(3000)")] - public string? State2 { get; init; } + [Column("STATE2", TypeName = "nvarchar(3000)")] + public string? State2 { get; init; } - [Column("STATE3", TypeName = "nvarchar(3000)")] - public string? State3 { get; init; } + [Column("STATE3", TypeName = "nvarchar(3000)")] + public string? State3 { get; init; } - [Column("STATE4", TypeName = "nvarchar(3000)")] - public string? State4 { get; init; } + [Column("STATE4", TypeName = "nvarchar(3000)")] + public string? State4 { get; init; } - [Required] - [Column("ADDED_WHO", TypeName = "varchar(30)")] - public required string AddedWho { get; init; } + [Required] + [Column("ADDED_WHO", TypeName = "varchar(30)")] + public required string AddedWho { get; init; } - [Required] - [Column("ADDED_WHEN", TypeName = "datetime")] - public required DateTime AddedWhen { get; init; } + [Required] + [Column("ADDED_WHEN", TypeName = "datetime")] + public required DateTime AddedWhen { get; init; } - [ForeignKey("ProfileId")] - public Profile? Profile { get; init; } = null; + [ForeignKey("ProfileId")] + public Profile? Profile { get; init; } = null; - [ForeignKey("UserId")] - public User? User { get; init; } = null; + [ForeignKey("UserId")] + public User? User { get; init; } = null; - [ForeignKey("StateId")] - public State? State { get; init; } = null; - } + [ForeignKey("StateId")] + public State? State { get; init; } = null; } \ No newline at end of file