add DocSignedNotificationStatusHandler and implement the natification into EnveloepControler

This commit is contained in:
2025-09-03 16:24:51 +02:00
parent aafed0f4f4
commit fb5d2110bd
5 changed files with 48 additions and 38 deletions

View File

@@ -13,6 +13,8 @@ using System.Dynamic;
using EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
using EnvelopeGenerator.Application.DocStatus.Commands;
using Newtonsoft.Json;
using EnvelopeGenerator.Application.Common.Notifications;
using DigitalData.Core.Exceptions;
namespace EnvelopeGenerator.Web.Controllers;
@@ -64,7 +66,11 @@ public class EnvelopeController : BaseController
if (await _mediator.IsSignedAsync(uuid, signature, cancel))
return Problem(statusCode: 403);
await _mediator.SignDocAsync(uuid, signature, JsonConvert.SerializeObject(annotations), cancel);
var notification = await _mediator.ReadEnvelopeReceiverAsync(envelopeKey, cancel)
.ToDocSignedNotification(annotations)
?? throw new NotFoundException("Envelope receiver is not found.");
await _mediator.Publish(notification, cancel);
EnvelopeReceiver response = await envelopeService.LoadEnvelope(envelopeKey);