- Introduced AnnotationCreateDto for creation-specific properties - AnnotationDto now inherits from AnnotationCreateDto and includes Id, AddedWhen, ChangedWhen, and ChangedWho - Added Type property to AnnotationCreateDto - remove CreateAnnotationCommand
34 lines
931 B
C#
34 lines
931 B
C#
using DigitalData.Core.Abstraction.Application.Repository;
|
|
using EnvelopeGenerator.Domain.Entities;
|
|
using MediatR;
|
|
|
|
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public class AnnotationHandler : INotificationHandler<DocSignedNotification>
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
private readonly IRepository<Annotation> _repo;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="repository"></param>
|
|
public AnnotationHandler(IRepository<Annotation> repository)
|
|
{
|
|
_repo = repository;
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="notification"></param>
|
|
/// <param name="cancel"></param>
|
|
/// <returns></returns>
|
|
public Task Handle(DocSignedNotification notification, CancellationToken cancel)
|
|
=> _repo.CreateAsync(notification.PsPdfKitAnnotation.Structured, cancel);
|
|
} |