feat(RemoveSignatureNotification): add ReceiverSignature to RemoveSignatureNotification

Added a new nullable ReceiverSignature property to the RemoveSignatureNotification record
to support handling receiver-specific signature removal events.
This commit is contained in:
tekh 2025-10-21 15:25:04 +02:00
parent d8ed06fdb6
commit 2c4c18935f
4 changed files with 12 additions and 6 deletions

View File

@ -28,6 +28,14 @@ public class RemoveAnnotationHandler : INotificationHandler<RemoveSignatureNotif
/// <returns></returns> /// <returns></returns>
public Task Handle(RemoveSignatureNotification notification, CancellationToken cancel) 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);
} }
} }

View File

@ -1,9 +1,7 @@
using DigitalData.Core.Abstraction.Application.Repository; using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Application.Common.Extensions; using EnvelopeGenerator.Application.Common.Extensions;
using EnvelopeGenerator.Application.Histories.Commands;
using EnvelopeGenerator.Domain.Constants; using EnvelopeGenerator.Domain.Constants;
using MediatR; using MediatR;
using Newtonsoft.Json;
namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature.Handlers; namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature.Handlers;

View File

@ -6,4 +6,5 @@ namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature;
/// ///
/// </summary> /// </summary>
/// <param name="EnvelopeUuid"></param> /// <param name="EnvelopeUuid"></param>
public record RemoveSignatureNotification(string EnvelopeUuid) : INotification; /// <param name="ReceiverSignature"></param>
public record RemoveSignatureNotification(string EnvelopeUuid, string? ReceiverSignature) : INotification;

View File

@ -112,8 +112,7 @@ public class Signature : ISignature, IHasReceiver
#if NET #if NET
? ?
#endif #endif
Receiver Receiver { get; set; }
{ get; set; }
public virtual IEnumerable<Annotation> public virtual IEnumerable<Annotation>
#if NET #if NET