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); +}