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:
@@ -28,6 +28,14 @@ public class RemoveAnnotationHandler : INotificationHandler<RemoveSignatureNotif
|
||||
/// <returns></returns>
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -6,4 +6,5 @@ namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature;
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="EnvelopeUuid"></param>
|
||||
public record RemoveSignatureNotification(string EnvelopeUuid) : INotification;
|
||||
/// <param name="ReceiverSignature"></param>
|
||||
public record RemoveSignatureNotification(string EnvelopeUuid, string? ReceiverSignature) : INotification;
|
||||
Reference in New Issue
Block a user