32 lines
943 B
C#
32 lines
943 B
C#
using DigitalData.Core.Abstraction.Application.Repository;
|
|
using MediatR;
|
|
|
|
namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature.Handlers;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public class RemoveAnnotationHandler : INotificationHandler<RemoveSignatureNotification>
|
|
{
|
|
private readonly IRepository<Domain.Entities.DocumentStatus> _repo;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="repository"></param>
|
|
public RemoveAnnotationHandler(IRepository<Domain.Entities.DocumentStatus> repository)
|
|
{
|
|
_repo = repository;
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="notification"></param>
|
|
/// <param name="cancel"></param>
|
|
/// <returns></returns>
|
|
public async Task Handle(RemoveSignatureNotification notification, CancellationToken cancel)
|
|
{
|
|
await _repo.DeleteAsync(s => s.Envelope!.Uuid == notification.EnvelopeUuid, cancel);
|
|
}
|
|
} |