feat(TestAnnotationController): include receiver signature in RemoveSignatureNotification

Updated TestAnnotationController.Delete to extract the receiver signature from the envelope key
and pass it along with the envelope UUID when publishing RemoveSignatureNotification.
Returns BadRequest if the signature is missing.
This commit is contained in:
tekh 2025-10-22 14:29:38 +02:00
parent 17c7e46388
commit 02ecd88758

View File

@ -9,7 +9,7 @@ namespace EnvelopeGenerator.Web.Controllers.Test;
[ApiController]
public class TestAnnotationController : ControllerBase
{
private IMediator _mediator;
private readonly IMediator _mediator;
public TestAnnotationController(IMediator mediator)
{
@ -19,12 +19,17 @@ public class TestAnnotationController : ControllerBase
[HttpDelete("{envelopeKey}")]
public async Task<IActionResult> Delete([FromRoute] string envelopeKey)
{
var uuid = envelopeKey.GetEnvelopeUuid();
if (uuid == null)
if (envelopeKey.GetEnvelopeUuid() is not string uuid)
return BadRequest();
await _mediator.Publish(new RemoveSignatureNotification(uuid));
if (envelopeKey.GetReceiverSignature() is not string signature)
return BadRequest();
await _mediator.Publish(new RemoveSignatureNotification()
{
EnvelopeUuid = uuid,
ReceiverSignature = signature
});
return Ok();
}
}