Files
EnvelopeGenerator/EnvelopeGenerator.Domain/Entities/EnvelopeReceiverReadOnly.cs
TekH e2afbc5a62 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.
2026-02-09 15:11:42 +01:00

57 lines
1.6 KiB
C#

using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using EnvelopeGenerator.Domain.Interfaces;
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
namespace EnvelopeGenerator.Domain.Entities
{
[Table("TBSIG_ENVELOPE_RECEIVER_READ_ONLY")]
public class EnvelopeReceiverReadOnly : IHasAddedWhen, IHasChangedWhen, IHasAddedWho
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Column("GUID")]
public long Id { get; set; }
[Column("ENVELOPE_ID")]
[Required]
public long EnvelopeId { get; set; }
//TODO: remove NotMapped attribute when EnvelopeId data type is standardized
[NotMapped]
public Envelope Envelope { get; set; }
[Column("RECEIVER_MAIL", TypeName = "nvarchar(250)")]
[Required]
[StringLength(250)]
[TemplatePlaceholder("NAME_RECEIVER")]
public string ReceiverMail { get; set; }
[Column("DATE_VALID")]
[Required]
public DateTime DateValid { get; set; }
[Column("ADDED_WHO", TypeName = "nvarchar(250)")]
[Required]
[StringLength(250)]
public string AddedWho { get; set; }
public Receiver Receiver { get; set; }
[Column("ADDED_WHEN")]
[Required]
public DateTime AddedWhen { get; set; }
[Column("CHANGED_WHO")]
[StringLength(100)]
public string
#if nullable
?
#endif
ChangedWho { get; set; }
[Column("CHANGED_WHEN")]
public DateTime? ChangedWhen { get; set; }
}
}