- Updated `using` directives in `Config.cs` and `EnvelopeType.cs` to include additional namespaces and removed `DigitalData.Core.Abstractions`. - Adjusted formatting for `StatusName` and `IsAlreadySent` properties in `Envelope.cs` for consistency. - Simplified `User` property in `Envelope.cs` by removing the namespace prefix. - Introduced a new `User` class in `User.cs` with various properties and data annotations for database mapping. - Removed the `<Nullable>` property from `EnvelopeGenerator.Domain.csproj`, which may impact nullability handling.
110 lines
3.3 KiB
C#
110 lines
3.3 KiB
C#
using EnvelopeGenerator.Common;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace EnvelopeGenerator.Domain.Entities
|
|
{
|
|
[Table("TBSIG_ENVELOPE", Schema = "dbo")]
|
|
public class Envelope
|
|
{
|
|
[Key]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
[Column("GUID")]
|
|
public int Id { get; set; }
|
|
|
|
[Required]
|
|
[Column("USER_ID")]
|
|
public int UserId { get; set; }
|
|
|
|
[Required]
|
|
[Column("STATUS")]
|
|
public int Status { get; set; }
|
|
|
|
[NotMapped]
|
|
public string StatusName => ((Constants.EnvelopeStatus)Status).ToString();
|
|
|
|
[Required]
|
|
[Column("ENVELOPE_UUID", TypeName = "nvarchar(36)")]
|
|
public string Uuid { get; set; }
|
|
|
|
[Column("MESSAGE", TypeName = "nvarchar(max)")]
|
|
public string Message { get; set; }
|
|
|
|
[Column("EXPIRES_WHEN", TypeName = "datetime")]
|
|
public DateTime ExpiresWhen { get; set; }
|
|
|
|
[Column("EXPIRES_WARNING_WHEN", TypeName = "datetime")]
|
|
public DateTime ExpiresWarningWhen { get; set; }
|
|
|
|
[Required]
|
|
[Column("ADDED_WHEN", TypeName = "datetime")]
|
|
public DateTime AddedWhen { get; set; }
|
|
|
|
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
|
public DateTime ChangedWhen { get; set; }
|
|
|
|
[Column("TITLE", TypeName = "nvarchar(128)")]
|
|
public string Title { get; set; }
|
|
|
|
[Column("CONTRACT_TYPE")]
|
|
public int ContractType { get; set; }
|
|
|
|
[Column("LANGUAGE", TypeName = "nvarchar(5)")]
|
|
public string Language { get; set; }
|
|
|
|
[Column("SEND_REMINDER_EMAILS")]
|
|
public bool SendReminderEmails { get; set; }
|
|
|
|
[Column("FIRST_REMINDER_DAYS")]
|
|
public int FirstReminderDays { get; set; }
|
|
|
|
[Column("REMINDER_INTERVAL_DAYS")]
|
|
public int ReminderIntervalDays { get; set; }
|
|
|
|
[Column("ENVELOPE_TYPE")]
|
|
public int EnvelopeTypeId { get; set; }
|
|
|
|
[Column("CERTIFICATION_TYPE")]
|
|
public int CertificationType { get; set; }
|
|
|
|
[Column("USE_ACCESS_CODE")]
|
|
public bool UseAccessCode { get; set; }
|
|
|
|
[Column("FINAL_EMAIL_TO_CREATOR")]
|
|
public int FinalEmailToCreator { get; set; }
|
|
|
|
[Column("FINAL_EMAIL_TO_RECEIVERS")]
|
|
public int FinalEmailToReceivers { get; set; }
|
|
|
|
[Column("EXPIRES_WHEN_DAYS")]
|
|
public int ExpiresWhenDays { get; set; }
|
|
|
|
[Column("EXPIRES_WARNING_WHEN_DAYS")]
|
|
public int ExpiresWarningWhenDays { get; set; }
|
|
|
|
[Column("TFA_ENABLED", TypeName = "bit")]
|
|
public bool TFAEnabled { get; set; }
|
|
|
|
[Column("DOC_RESULT", TypeName = "varbinary(max)")]
|
|
public byte[] DocResult { get; set; }
|
|
|
|
/// <summary>
|
|
/// The sender of envelope
|
|
/// </summary>
|
|
[ForeignKey("UserId")]
|
|
public User User { get; set; }
|
|
|
|
[ForeignKey("EnvelopeTypeId")]
|
|
public EnvelopeType EnvelopeType { get; set; }
|
|
|
|
[NotMapped]
|
|
public string EnvelopeTypeTitle => EnvelopeType.Title;
|
|
|
|
[NotMapped]
|
|
public bool IsAlreadySent => Status > (int)Constants.EnvelopeStatus.EnvelopeSaved;
|
|
|
|
public IEnumerable<EnvelopeDocument> Documents { get; set; }
|
|
|
|
public IEnumerable<EnvelopeHistory> History { get; set; }
|
|
}
|
|
} |