using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Drawing; #if NETFRAMEWORK using System; using System.Collections.Generic; #endif namespace EnvelopeGenerator.Domain.Entities #if NET ; #elif NETFRAMEWORK { #endif [Table("TBSIG_RECEIVER", Schema = "dbo")] public class Receiver { [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 EnvelopeReceivers { get; set; } #region Model of old serice [NotMapped] public DateTime SignedDate { get; set; } = DateTime.MinValue; [NotMapped] public Constants.ColorType ColorType { get; set; } [NotMapped] public string SignedDateDisplayValue => SignedDate == DateTime.MinValue ? "-" : SignedDate.ToString("G"); [NotMapped] public Color Color => ColorType.ToColor(); public string GetSignature() { return EmailAddress.ToUpperInvariant().GetChecksum(); } #endregion } #if NETFRAMEWORK } #endif