refactor(RemoveDocStatusHandler): update RemoveDocStatusHandler to support conditional receiver signature filtering
Updated the RemoveDocStatusHandler to refine document status deletion logic. Now filters by EnvelopeUuid and optionally by ReceiverSignature when provided.
This commit is contained in:
parent
2c4c18935f
commit
b57c0aa9c7
@ -25,8 +25,16 @@ public class RemoveDocStatusHandler : INotificationHandler<RemoveSignatureNotifi
|
|||||||
/// <param name="notification"></param>
|
/// <param name="notification"></param>
|
||||||
/// <param name="cancel"></param>
|
/// <param name="cancel"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task Handle(RemoveSignatureNotification notification, CancellationToken cancel)
|
public Task Handle(RemoveSignatureNotification notification, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
await _repo.DeleteAsync(s => s.Envelope!.Uuid == notification.EnvelopeUuid, cancel);
|
return _repo.DeleteAsync(statuses =>
|
||||||
|
{
|
||||||
|
statuses = statuses.Where(status => status.Envelope!.Uuid == notification.EnvelopeUuid);
|
||||||
|
|
||||||
|
if (notification.ReceiverSignature is string signature)
|
||||||
|
statuses = statuses.Where(status => status.Receiver!.Signature == signature);
|
||||||
|
|
||||||
|
return statuses;
|
||||||
|
}, cancel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user