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;
|
|
|
|
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 Constants.EnvelopeStatus Status { get; set; }
|
|
|
|
/// <summary>
|
|
/// Type of reference for this history entry.
|
|
/// </summary>
|
|
public Constants.ReferenceType ReferenceType => ((int)Status).ToString().FirstOrDefault() switch
|
|
{
|
|
'1' => Constants.ReferenceType.Sender,
|
|
'2' => Constants.ReferenceType.Receiver,
|
|
_ => Constants.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();
|
|
}; |