fix references
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
using DigitalData.UserManager.Application.DTOs.User;
|
||||
using EnvelopeGenerator.Application.Common.Dto.Receiver;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Common.Dto.History;
|
||||
|
||||
/// <summary>
|
||||
/// Data Transfer Object representing the history of an envelope, including status, sender, receiver, and related metadata.
|
||||
/// </summary>
|
||||
public record HistoryDto
|
||||
{
|
||||
/// <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 ReceiverDto? Receiver { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional comment related to this history entry.
|
||||
/// </summary>
|
||||
public string? Comment { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Id.GetHashCode();
|
||||
};
|
||||
Reference in New Issue
Block a user