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.
51 lines
1.3 KiB
C#
51 lines
1.3 KiB
C#
using System;
|
|
using EnvelopeGenerator.Domain.Interfaces;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Drawing;
|
|
#if NETFRAMEWORK
|
|
using System.Collections.Generic;
|
|
#endif
|
|
|
|
namespace EnvelopeGenerator.Domain.Entities
|
|
#if NET
|
|
;
|
|
#elif NETFRAMEWORK
|
|
{
|
|
#endif
|
|
|
|
[Table("TBSIG_RECEIVER", Schema = "dbo")]
|
|
public class Receiver : IHasAddedWhen
|
|
{
|
|
[Key]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
[Column("GUID")]
|
|
public int Id { get; set; }
|
|
|
|
[Required, EmailAddress]
|
|
[Column("EMAIL_ADDRESS", TypeName = "nvarchar(250)")]
|
|
[StringLength(250)]
|
|
public string EmailAddress { get; set; }
|
|
|
|
[Required]
|
|
[Column("SIGNATURE", TypeName = "nvarchar(64)")]
|
|
public string Signature { get; set; }
|
|
|
|
[Required]
|
|
[Column("ADDED_WHEN", TypeName = "datetime")]
|
|
public DateTime AddedWhen { get; set; }
|
|
|
|
[Column("TOTP_SECRET_KEY", TypeName = "nvarchar(MAX)")]
|
|
public string TotpSecretkey { get; set; }
|
|
|
|
[Column("TFA_REG_DEADLINE", TypeName = "datetime")]
|
|
public DateTime? TfaRegDeadline { get; set; }
|
|
|
|
public List<EnvelopeReceiver> EnvelopeReceivers { get; set; }
|
|
|
|
public string GetSignature() => EmailAddress.ToUpperInvariant().GetChecksum();
|
|
}
|
|
|
|
#if NETFRAMEWORK
|
|
}
|
|
#endif |