refactor(ReceiverAlreadySignedQuery): update to use common models

This commit is contained in:
Developer 02 2025-08-26 17:29:07 +02:00
parent c5918b8e49
commit 405b619bdc

View File

@ -1,5 +1,6 @@
using DigitalData.Core.Abstraction.Application.Repository;
using DigitalData.Core.Exceptions;
using EnvelopeGenerator.Application.Model;
using EnvelopeGenerator.Domain;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Extensions;
@ -11,58 +12,7 @@ namespace EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
/// <summary>
///
/// </summary>
public record ReceiverAlreadySignedQuery : IRequest<bool>
{
/// <summary>
///
/// </summary>
public string Key
{
get => (Envelope.Uuid, Receiver.Signature).EncodeEnvelopeReceiverId();
init
{
(string? EnvelopeUuid, string? ReceiverSignature) = value.DecodeEnvelopeReceiverId();
if (string.IsNullOrEmpty(EnvelopeUuid) || string.IsNullOrEmpty(ReceiverSignature))
{
throw new BadRequestException("Der EnvelopeReceiverKey muss ein gültiger Base64-kodierter String sein, der die EnvelopeUuid und die ReceiverSignature enthält.");
}
}
}
/// <summary>
///
/// </summary>
public EnvelopeQuery Envelope { get; set; } = new EnvelopeQuery();
/// <summary>
///
/// </summary>
public ReceiverQuery Receiver { get; set; } = new ReceiverQuery();
}
#region Queries
/// <summary>
///
/// </summary>
public record EnvelopeQuery()
{
/// <summary>
///
/// </summary>
public string Uuid { get; set; } = null!;
};
/// <summary>
///
/// </summary>
public record ReceiverQuery()
{
/// <summary>
///
/// </summary>
public string Signature { get; set; } = null!;
};
#endregion
public record ReceiverAlreadySignedQuery : EnvelopeReceiverQueryBase, IRequest<bool>;
/// <summary>
///