Refactored Envelope, Receiver, and Signature entity classes to eliminate preprocessor directives around class and property definitions. Applied attributes directly and reformatted properties for clarity. Constructors are now always present, with default initializations still conditional where needed. Removed obsolete directives from IHasAddedWho. These changes improve code readability, maintainability, and cross-platform compatibility.
42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
using EnvelopeGenerator.Domain.Interfaces;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
#if NETFRAMEWORK
|
|
using System;
|
|
using System.Collections.Generic;
|
|
#endif
|
|
|
|
namespace EnvelopeGenerator.Domain.Entities
|
|
{
|
|
[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();
|
|
}
|
|
} |