Add audit interfaces and fields to domain entities

Introduced interfaces for audit fields (AddedWhen, ChangedWhen, ChangedWho, AddedWho) and updated domain entities to implement them. Adjusted properties for consistency and nullability. Updated MappingProfile to map audit fields between DTOs and entities. Improves auditability and standardization across the domain model.
This commit is contained in:
2026-02-09 15:11:42 +01:00
parent 0fb94decdd
commit e2afbc5a62
15 changed files with 128 additions and 78 deletions

View File

@@ -1,24 +1,20 @@
using DigitalData.UserManager.Domain.Entities;
using System;
using DigitalData.UserManager.Domain.Entities;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using EnvelopeGenerator.Domain.Interfaces;
using EnvelopeGenerator.Domain.Constants;
using DigitalData.Core.Abstractions.Interfaces;
#if NETFRAMEWORK
using System;
#endif
namespace EnvelopeGenerator.Domain.Entities
#if NET
;
#elif NETFRAMEWORK
{
{
#endif
[Table("TBSIG_ENVELOPE_HISTORY", Schema = "dbo")]
public class History : IHasEnvelope, IHasReceiver, IEntity
public class History : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasChangedWhen
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -43,7 +39,7 @@ public class History : IHasEnvelope, IHasReceiver, IEntity
public DateTime AddedWhen { get; set; }
[Column("ACTION_DATE", TypeName = "datetime")]
public DateTime? ActionDate { get; set; } = DateTime.Now;
public DateTime? ChangedWhen { get; set; }
[Column("COMMENT", TypeName = "nvarchar(max)")]
public string