Refactor data model: rename entities and update mappings

This commit includes a significant refactoring of the data model, renaming `ProfileObject` to `PObject` and `ProfileControlsTF` to `PControlsTF`.

Key changes:
- Updated `IProfileObjRepository` to reflect new entity names.
- Added `TFControls` property to `ObjectDto`.
- Adjusted `MappingProfile` for new entity mappings.
- Replaced `ProfileControlsTF` and `ProfileObjState` with `PControlsTF` and `PObjectState`.
- Updated `WFDBContext` with new DbSet properties for the renamed entities.
- Modified `ProfileObjRepository` to align with the new data structure.

These changes enhance clarity and maintainability across the application.
This commit is contained in:
2025-08-01 12:02:34 +02:00
parent c2e8b335e0
commit a3cbe69fd6
10 changed files with 33 additions and 40 deletions

View File

@@ -4,20 +4,15 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace WorkFlow.Domain.Entities;
[Table("TBMWF_PROF_CONTROLS_TF", Schema = "dbo")]
public class ProfileControlsTF
public class PControlsTF
{
[Key]
[Column("GUID", TypeName = "bigint")]
public long Id { get; set; }
/// <summary>
/// Although this field is marked as <c>nullable</c> in the database schema to allow
/// for greater flexibility during database-level operations or migrations, it is
/// treated as <c>required</c> and <c>not null</c> within the application logic.
/// Validation should be enforced at the application level to ensure a value is provided.
/// </summary>
[Required]
[Column("OBJ_STATE_ID", TypeName = "bigint")]
public long? ObjStateId { get; set; }
public long ObjStateId { get; set; }
/// <summary>
/// Although this field is marked as <c>nullable</c> in the database schema to allow
@@ -96,7 +91,4 @@ public class ProfileControlsTF
[Column("ADDED_WHEN", TypeName = "datetime")]
public DateTime AddedWhen { get; set; }
[ForeignKey("ObjStateId")]
public virtual ProfileObjState? State { get; set; }
}

View File

@@ -2,7 +2,7 @@
namespace WorkFlow.Domain.Entities;
public class ProfileObject
public class PObject
{
[Column("ObjStateID")]
public long? ObjStateId { get; set; }
@@ -26,5 +26,5 @@ public class ProfileObject
public string? CmdCheckIn { get; set; }
[ForeignKey("ObjStateId")]
public virtual ProfileObjState? States { get; set; }
public virtual PObjectState? State { get; set; }
}

View File

@@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace WorkFlow.Domain.Entities;
[Table("TBMWF_PROFILE_OBJ_STATE", Schema = "dbo")]
public class ProfileObjState
public class PObjectState
{
[Key]
[Column("GUID", TypeName = "bigint")]
@@ -82,7 +82,7 @@ public class ProfileObjState
[ForeignKey("ObjStateId")]
public virtual State? State1 { get; set; }
public IEnumerable<ProfileControlsTF> TFControls { get; set; } = Array.Empty<ProfileControlsTF>();
public IEnumerable<PControlsTF> TFControls { get; set; } = Array.Empty<PControlsTF>();
public IEnumerable<string?> ToList() => new List<string?>
{

View File

@@ -26,7 +26,7 @@ public class Profile
public string? BackColor { get; set; }
[NotMapped]
public IEnumerable<ProfileObject>? Objects { get; set; }
public IEnumerable<PObject>? Objects { get; set; }
[NotMapped]
public IEnumerable<Button>? Buttons { get; set; }