Developer 02 41b2841c25 Add validation to ReadHistoryQuery and remove StatusName
Updated ReadHistoryQuery to include a [Required] attribute for the EnvelopeId property, enforcing mandatory validation. Removed the StatusName property from ReadHistoryResponse, which may impact how status is accessed in the application.
2025-05-12 11:07:53 +02:00

60 lines
1.7 KiB
C#

using EnvelopeGenerator.Common;
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 Common.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();
}
}