From 2c4c18935f16edd043cba8f2ad750f2f66580241 Mon Sep 17 00:00:00 2001 From: TekH Date: Tue, 21 Oct 2025 15:25:04 +0200 Subject: [PATCH] feat(RemoveSignatureNotification): add ReceiverSignature to RemoveSignatureNotification Added a new nullable ReceiverSignature property to the RemoveSignatureNotification record to support handling receiver-specific signature removal events. --- .../Handlers/RemoveAnnotationHandler.cs | 10 +++++++++- .../RemoveSignature/Handlers/RemoveHistoryHandler.cs | 2 -- .../RemoveSignature/RemoveSignatureNotification.cs | 3 ++- EnvelopeGenerator.Domain/Entities/Signature.cs | 3 +-- 4 files changed, 12 insertions(+), 6 deletions(-) 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