Introduced AutoMapperAuditingExtensions with MapAddedWhen and MapChangedWhen methods to standardize mapping of auditing timestamps. Refactored MappingProfile to use these extensions for AddedWhen and ChangedWhen fields, improving code clarity. Updated DocumentStatus to implement auditing interfaces and added necessary imports.
62 lines
1.7 KiB
C#
62 lines
1.7 KiB
C#
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using DigitalData.Core.Abstractions.Interfaces;
|
|
using EnvelopeGenerator.Domain.Interfaces;
|
|
using EnvelopeGenerator.Domain.Interfaces.Auditing;
|
|
|
|
namespace EnvelopeGenerator.Domain.Entities
|
|
{
|
|
[Table("TBSIG_DOCUMENT_STATUS", Schema = "dbo")]
|
|
public class DocumentStatus : IHasEnvelope, IHasReceiver, IEntity, IHasAddedWhen, IHasChangedWhen
|
|
{
|
|
public DocumentStatus()
|
|
{
|
|
// TODO: * check Form Application and remove default value
|
|
#if NETFRAMEWORK
|
|
Status = Constants.DocumentStatus.Created;
|
|
#endif
|
|
}
|
|
|
|
[Key]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
[Column("GUID")]
|
|
public int Id { get; set; }
|
|
|
|
[Required]
|
|
[Column("ENVELOPE_ID")]
|
|
public int EnvelopeId { get; set; }
|
|
|
|
[Required]
|
|
[Column("RECEIVER_ID")]
|
|
public int ReceiverId { get; set; }
|
|
|
|
[Required]
|
|
[Column("STATUS")]
|
|
public Constants.DocumentStatus Status { get; set; }
|
|
|
|
[Required]
|
|
[Column("ADDED_WHEN", TypeName = "datetime")]
|
|
public DateTime AddedWhen { get; set; }
|
|
|
|
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
|
public DateTime? ChangedWhen { get; set; }
|
|
|
|
[Column("VALUE", TypeName = "nvarchar(max)")]
|
|
public string Value { get; set; }
|
|
|
|
[ForeignKey("EnvelopeId")]
|
|
public virtual Envelope
|
|
#if nullable
|
|
?
|
|
#endif
|
|
Envelope { get; set; }
|
|
|
|
[ForeignKey("ReceiverId")]
|
|
public virtual Receiver
|
|
#if nullable
|
|
?
|
|
#endif
|
|
Receiver { get; set; }
|
|
}
|
|
} |