using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
///
///
///
public class AnnotationHandler : INotificationHandler
{
///
///
///
private readonly IRepository _repo;
///
///
///
///
public AnnotationHandler(IRepository repository)
{
_repo = repository;
}
///
///
///
///
///
///
public async Task Handle(DocSignedNotification notification, CancellationToken cancel)
{
if (notification.PsPdfKitAnnotation is PsPdfKitAnnotation annot)
await _repo.CreateAsync(annot.Structured, cancel);
}
}