Updated references from `Constants` to direct usage of `EnvelopeStatus` and `EmailTemplateType` enums. This change enhances code readability and reduces dependency on the `Constants` class. Modified properties and parameters across command classes, DTOs, repositories, and services to use the enums directly. Updated `ModifyDocStatusCommandBase`, `EnvelopeHistoryDto`, and `ResetEmailTemplateCommand` for improved clarity. Consistent updates across multiple files indicate a systematic refactoring aimed at streamlining the codebase and improving maintainability. Comments and documentation have also been revised to reflect these changes.
74 lines
2.2 KiB
C#
74 lines
2.2 KiB
C#
using DigitalData.UserManager.Application.DTOs.User;
|
|
using EnvelopeGenerator.Application.Dto.Receiver;
|
|
using EnvelopeGenerator.Domain.Constants;
|
|
|
|
namespace EnvelopeGenerator.Application.Dto.EnvelopeHistory;
|
|
|
|
/// <summary>
|
|
/// Data Transfer Object representing the history of an envelope, including status, sender, receiver, and related metadata.
|
|
/// </summary>
|
|
public record EnvelopeHistoryDto
|
|
{
|
|
/// <summary>
|
|
/// Unique identifier for the envelope history entry.
|
|
/// </summary>
|
|
public long Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// Identifier of the associated envelope.
|
|
/// </summary>
|
|
public int EnvelopeId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Reference string for the user related to this history entry.
|
|
/// </summary>
|
|
public required string UserReference { get; set; }
|
|
|
|
/// <summary>
|
|
/// Include code of the envelope at this history point.
|
|
/// </summary>
|
|
public EnvelopeStatus Status { get; set; }
|
|
|
|
/// <summary>
|
|
/// Type of reference for this history entry.
|
|
/// </summary>
|
|
public ReferenceType ReferenceType => ((int)Status).ToString().FirstOrDefault() switch
|
|
{
|
|
'1' => ReferenceType.Sender,
|
|
'2' => ReferenceType.Receiver,
|
|
_ => ReferenceType.System,
|
|
};
|
|
|
|
/// <summary>
|
|
/// Human-readable name of the status.
|
|
/// </summary>
|
|
public string? StatusName { get; set; }
|
|
|
|
/// <summary>
|
|
/// Date and time when this history entry was added.
|
|
/// </summary>
|
|
public DateTime AddedWhen { get; set; }
|
|
|
|
/// <summary>
|
|
/// Date and time when an action was performed, if applicable.
|
|
/// </summary>
|
|
public DateTime? ActionDate { get; set; }
|
|
|
|
/// <summary>
|
|
/// Information about the sender associated with this history entry.
|
|
/// </summary>
|
|
public UserCreateDto? Sender { get; set; }
|
|
|
|
/// <summary>
|
|
/// Information about the receiver associated with this history entry.
|
|
/// </summary>
|
|
public ReceiverReadDto? Receiver { get; set; }
|
|
|
|
/// <summary>
|
|
/// Optional comment related to this history entry.
|
|
/// </summary>
|
|
public string? Comment { get; set; }
|
|
|
|
/// <inheritdoc/>
|
|
public override int GetHashCode() => Id.GetHashCode();
|
|
}; |