61 lines
1.7 KiB
C#

using EnvelopeGenerator.CommonServices;
using EnvelopeGenerator.Domain;
namespace EnvelopeGenerator.Application.Histories.Queries.Read;
/// <summary>
/// Represents the history of an envelope, including its status, user actions, and references.
/// </summary>
public class ReadHistoryResponse
{
/// <summary>
/// Gets or sets the unique identifier of the envelope history record.
/// </summary>
public long Id { get; set; }
/// <summary>
/// Gets or sets the identifier of the associated envelope.
/// </summary>
public int EnvelopeId { get; set; }
/// <summary>
/// Gets or sets the reference identifier of the user who performed the action.
/// </summary>
public string UserReference { get; set; }
/// <summary>
/// Gets or sets the status code of the envelope.
/// </summary>
public int Status { get; set; }
/// <summary>
///
/// </summary>
public Constants.ReferenceType ReferenceType => Status.ToString().FirstOrDefault() switch
{
'1' => Constants.ReferenceType.Sender,
'2' => Constants.ReferenceType.Receiver,
_ => Constants.ReferenceType.System,
};
/// <summary>
/// Gets or sets the date and time when the record was added.
/// </summary>
public DateTime AddedWhen { get; set; }
/// <summary>
/// Gets or sets the date and time when the action occurred.
/// </summary>
public DateTime? ActionDate { get; set; }
/// <summary>
/// Gets or sets the optional comment about the envelope history record.
/// </summary>
public string? Comment { get; set; }
/// <inheritdoc/>
public override int GetHashCode()
{
return Id.GetHashCode();
}
}