- Introduced a new `DocResult` property in `EnvelopeDto.cs` and `Envelope.cs` for handling binary data. - Rearranged properties in `EnvelopeDto.cs` for better organization. - Modified `EnvelopeController` to return a collection of envelopes instead of a single envelope.
111 lines
3.4 KiB
C#
111 lines
3.4 KiB
C#
using DigitalData.Core.Abstractions;
|
|
using EnvelopeGenerator.Common;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace EnvelopeGenerator.Domain.Entities
|
|
{
|
|
[Table("TBSIG_ENVELOPE", Schema = "dbo")]
|
|
public class Envelope : IUnique<int>
|
|
{
|
|
[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 required string Uuid { get; init; }
|
|
|
|
[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; init; }
|
|
|
|
/// <summary>
|
|
/// The sender of envelope
|
|
/// </summary>
|
|
[ForeignKey("UserId")]
|
|
public DigitalData.UserManager.Domain.Entities.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; }
|
|
}
|
|
} |