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
This commit is contained in:
tekh 2025-10-16 14:28:25 +02:00
parent e64ad44b71
commit 16e5d5c692

View File

@ -0,0 +1,38 @@
using EnvelopeGenerator.Application.Annotations.Commands;
using MediatR;
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
/// <summary>
///
/// </summary>
public class AnnotationHandler : INotificationHandler<DocSignedNotification>
{
/// <summary>
///
/// </summary>
private readonly ISender _sender;
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
public AnnotationHandler(ISender sender)
{
_sender = sender;
}
/// <summary>
///
/// </summary>
/// <param name="notification"></param>
/// <param name="cancel"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
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);
}