From 16e5d5c6920758d6853622f67f7fa59e112b0532 Mon Sep 17 00:00:00 2001 From: TekH Date: Thu, 16 Oct 2025 14:28:25 +0200 Subject: [PATCH] feat(AnnotationHandler): add handler for DocSignedNotification to create annotations - Implemented AnnotationHandler to process DocSignedNotification events - Sends CreateAnnotationCommand via MediatR with envelope, receiver, and annotations data --- .../DocSigned/Handlers/AnnotationHandler.cs | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 EnvelopeGenerator.Application/Common/Notifications/DocSigned/Handlers/AnnotationHandler.cs diff --git a/EnvelopeGenerator.Application/Common/Notifications/DocSigned/Handlers/AnnotationHandler.cs b/EnvelopeGenerator.Application/Common/Notifications/DocSigned/Handlers/AnnotationHandler.cs new file mode 100644 index 00000000..41781708 --- /dev/null +++ b/EnvelopeGenerator.Application/Common/Notifications/DocSigned/Handlers/AnnotationHandler.cs @@ -0,0 +1,38 @@ +using EnvelopeGenerator.Application.Annotations.Commands; +using MediatR; + +namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers; + +/// +/// +/// +public class AnnotationHandler : INotificationHandler +{ + /// + /// + /// + private readonly ISender _sender; + + /// + /// + /// + /// + public AnnotationHandler(ISender sender) + { + _sender = sender; + } + + /// + /// + /// + /// + /// + /// + /// + public Task Handle(DocSignedNotification notification, CancellationToken cancel) => _sender.Send(new CreateAnnotationCommand() + { + Envelope = new() { Id = notification.EnvelopeId }, + Receiver = new() { Id = notification.ReceiverId }, + PSPDFKitInstant = notification.Annotations + }, cancel); +}