From 547d723f470f4cb4ae5bfbc239396c9ce13d38e4 Mon Sep 17 00:00:00 2001 From: TekH Date: Fri, 18 Jul 2025 15:44:49 +0200 Subject: [PATCH] refactor(Profile): simplify Profile entity and remove unused metadata - Removed dependency on IUnique interface - Removed validation and database annotations like [Required], [Key] - Renamed/updated column mappings and replaced required fields with nullable types - Removed metadata fields such as AddedWho, AddedWhen, ChangedWho, ChangedWhen, etc. - Cleaned up namespace and using directives --- src/WorkFlow.Domain/Entities/Profile.cs | 65 +++++++++---------------- 1 file changed, 24 insertions(+), 41 deletions(-) diff --git a/src/WorkFlow.Domain/Entities/Profile.cs b/src/WorkFlow.Domain/Entities/Profile.cs index b3deb49..3548746 100644 --- a/src/WorkFlow.Domain/Entities/Profile.cs +++ b/src/WorkFlow.Domain/Entities/Profile.cs @@ -1,44 +1,27 @@ -using DigitalData.Core.Abstractions; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; -namespace WorkFlow.Domain.Entities +namespace WorkFlow.Domain.Entities; + +public class Profile { - [Table("TBMWF_PROFILE", Schema = "dbo")] - public class Profile : IUnique - { - [Key] - [Column("GUID")] - public int Id { get; init; } - - [Required] - [Column("INTL_NAME", TypeName = "varchar(200)")] - public required string IntlName { get; init; } - - [Required] - [Column("EXT_ID1")] - public required int ExtId1 { get; init; } - - [Required] - [Column("ACTIVE")] - public required bool Active { 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; } - - [Column("CHANGED_WHO", TypeName = "varchar(30)")] - public string? ChangedWho { get; init; } - - [Column("CHANGED_WHEN", TypeName = "datetime")] - public DateTime? ChangedWhen { get; init; } - - [Required] - [Column("TYPE_ID")] - public required byte TypeId { get; init; } - } + [Column("PROFILE_ID")] + public int? Id { get; set; } + + [Column("TYPE_ID")] + public int? TypeId { get; set; } + + [Column("CAPTION")] + public string? Caption { get; set; } + + [Column("SUBTITLE")] + public string? Subtitle { get; set; } + + [Column("COUNTOBJ")] + public int? CountObj { get; set; } + + [Column("FORE_COLOR")] + public string? ForeColor { get; set; } + + [Column("BACK_COLOR")] + public string? BackColor { get; set; } } \ No newline at end of file