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:
@@ -1,21 +1,21 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using DigitalData.Core.Abstractions.Interfaces;
|
||||
using EnvelopeGenerator.Domain.Interfaces;
|
||||
|
||||
#if NETFRAMEWORK
|
||||
using System;
|
||||
#endif
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
#if NET
|
||||
;
|
||||
#elif NETFRAMEWORK
|
||||
{
|
||||
{
|
||||
#endif
|
||||
|
||||
[Table("TBSIG_ENVELOPE_RECEIVER", Schema = "dbo")]
|
||||
public class EnvelopeReceiver : IHasEnvelope, IHasReceiver, IEntity
|
||||
public class EnvelopeReceiver : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasChangedWhen
|
||||
{
|
||||
public EnvelopeReceiver()
|
||||
{
|
||||
@@ -42,7 +42,7 @@ public class EnvelopeReceiver : IHasEnvelope, IHasReceiver, IEntity
|
||||
|
||||
[Column("COMPANY_NAME", TypeName = "nvarchar(128)")]
|
||||
public string
|
||||
#if NET
|
||||
#if nullable
|
||||
?
|
||||
#endif
|
||||
CompanyName { get; set; }
|
||||
@@ -58,7 +58,7 @@ public class EnvelopeReceiver : IHasEnvelope, IHasReceiver, IEntity
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
||||
public DateTime ChangedWhen { get; set; }
|
||||
public DateTime? ChangedWhen { get; set; }
|
||||
|
||||
[Column("PHONE_NUMBER")]
|
||||
[StringLength(20)]
|
||||
@@ -73,14 +73,14 @@ public class EnvelopeReceiver : IHasEnvelope, IHasReceiver, IEntity
|
||||
|
||||
[ForeignKey("EnvelopeId")]
|
||||
public Envelope
|
||||
#if NET
|
||||
#if nullable
|
||||
?
|
||||
#endif
|
||||
Envelope { get; set; }
|
||||
|
||||
[ForeignKey("ReceiverId")]
|
||||
public Receiver
|
||||
#if NET
|
||||
#if nullable
|
||||
?
|
||||
#endif
|
||||
Receiver { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user