refactor(ReadHistoryQuery): update to use dto and remove response class

This commit is contained in:
Developer 02
2025-08-28 18:15:47 +02:00
parent b8c348afb6
commit e0af5b769d
4 changed files with 18 additions and 70 deletions

View File

@@ -1,5 +1,6 @@
using DigitalData.UserManager.Application.DTOs.User;
using EnvelopeGenerator.Application.Dto.Receiver;
using EnvelopeGenerator.Domain;
using static EnvelopeGenerator.Domain.Constants;
namespace EnvelopeGenerator.Application.Dto.EnvelopeHistory;
@@ -29,6 +30,16 @@ public record EnvelopeHistoryDto
/// </summary>
public int Status { get; set; }
/// <summary>
/// Type of reference for this history entry.
/// </summary>
public Constants.ReferenceType ReferenceType => Status.ToString().FirstOrDefault() switch
{
'1' => Constants.ReferenceType.Sender,
'2' => Constants.ReferenceType.Receiver,
_ => Constants.ReferenceType.System,
};
/// <summary>
/// Human-readable name of the status.
/// </summary>
@@ -54,11 +65,6 @@ public record EnvelopeHistoryDto
/// </summary>
public ReceiverReadDto? Receiver { get; set; }
/// <summary>
/// Type of reference for this history entry.
/// </summary>
public ReferenceType ReferenceType { get; set; }
/// <summary>
/// Optional comment related to this history entry.
/// </summary>