diff --git a/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/Handlers/RemoveAnnotationHandler.cs b/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/Handlers/RemoveAnnotationHandler.cs index d64cc958..46fba50f 100644 --- a/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/Handlers/RemoveAnnotationHandler.cs +++ b/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/Handlers/RemoveAnnotationHandler.cs @@ -28,6 +28,14 @@ public class RemoveAnnotationHandler : INotificationHandler public Task Handle(RemoveSignatureNotification notification, CancellationToken cancel) { - return _repo.DeleteAsync(a => a.Element!.Document.Envelope!.Uuid == notification.EnvelopeUuid, cancel); + return _repo.DeleteAsync(annots => + { + annots = annots.Where(annot => annot.Element!.Document.Envelope!.Uuid == notification.EnvelopeUuid); + + if (notification.ReceiverSignature is string signature) + annots = annots.Where(annot => annot.Element!.Receiver!.Signature == signature); + + return annots; + }, cancel); } } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/Handlers/RemoveHistoryHandler.cs b/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/Handlers/RemoveHistoryHandler.cs index 5c0742ad..bc69d682 100644 --- a/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/Handlers/RemoveHistoryHandler.cs +++ b/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/Handlers/RemoveHistoryHandler.cs @@ -1,9 +1,7 @@ using DigitalData.Core.Abstraction.Application.Repository; using EnvelopeGenerator.Application.Common.Extensions; -using EnvelopeGenerator.Application.Histories.Commands; using EnvelopeGenerator.Domain.Constants; using MediatR; -using Newtonsoft.Json; namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature.Handlers; diff --git a/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/RemoveSignatureNotification.cs b/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/RemoveSignatureNotification.cs index b896870b..e7893024 100644 --- a/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/RemoveSignatureNotification.cs +++ b/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/RemoveSignatureNotification.cs @@ -6,4 +6,5 @@ namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature; /// /// /// -public record RemoveSignatureNotification(string EnvelopeUuid) : INotification; \ No newline at end of file +/// +public record RemoveSignatureNotification(string EnvelopeUuid, string? ReceiverSignature) : INotification; \ No newline at end of file diff --git a/EnvelopeGenerator.Domain/Entities/Signature.cs b/EnvelopeGenerator.Domain/Entities/Signature.cs index 0d0c2d80..798d4723 100644 --- a/EnvelopeGenerator.Domain/Entities/Signature.cs +++ b/EnvelopeGenerator.Domain/Entities/Signature.cs @@ -112,8 +112,7 @@ public class Signature : ISignature, IHasReceiver #if NET ? #endif - Receiver - { get; set; } + Receiver { get; set; } public virtual IEnumerable #if NET