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,4 +1,5 @@
|
||||
using EnvelopeGenerator.Domain.Interfaces;
|
||||
using System;
|
||||
using EnvelopeGenerator.Domain.Interfaces;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
#if NETFRAMEWORK
|
||||
@@ -11,11 +12,11 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
#if NET
|
||||
;
|
||||
#elif NETFRAMEWORK
|
||||
{
|
||||
{
|
||||
#endif
|
||||
|
||||
[Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")]
|
||||
public class Document : IHasEnvelope
|
||||
public class Document : IHasEnvelope, IHasAddedWhen
|
||||
{
|
||||
public Document()
|
||||
{
|
||||
@@ -36,9 +37,13 @@ public class Document : IHasEnvelope
|
||||
= 0;
|
||||
#endif
|
||||
|
||||
[Required]
|
||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
[Column("BYTE_DATA", TypeName = "varbinary(max)")]
|
||||
public byte[]
|
||||
#if NET
|
||||
#if nullable
|
||||
?
|
||||
#endif
|
||||
ByteData { get; set; }
|
||||
@@ -52,21 +57,21 @@ public class Document : IHasEnvelope
|
||||
|
||||
[Column("FILENAME_ORIGINAL", TypeName = "nvarchar(256)")]
|
||||
public string
|
||||
#if NET
|
||||
#if nullable
|
||||
?
|
||||
#endif
|
||||
FileNameOriginal { get; set; }
|
||||
#endregion
|
||||
|
||||
public virtual List<Signature>
|
||||
#if NET
|
||||
#if nullable
|
||||
?
|
||||
#endif
|
||||
Elements { get; set; }
|
||||
|
||||
[ForeignKey("EnvelopeId")]
|
||||
public virtual Envelope
|
||||
#if NET
|
||||
#if nullable
|
||||
?
|
||||
#endif
|
||||
Envelope { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user