refactor(RemoveSignatureNotification): Alle Filter von Handlern an die Bedingung binden, dass sie nicht null sind.
This commit is contained in:
@@ -31,12 +31,23 @@ public class RemoveHistoryHandler : INotificationHandler<RemoveSignatureNotifica
|
||||
{
|
||||
return _repo.DeleteAsync(hists =>
|
||||
{
|
||||
hists = hists
|
||||
.Where(hist => hist.Envelope!.Uuid == notification.EnvelopeUuid)
|
||||
.Where(hist => hist.Status == EnvelopeStatus.DocumentSigned);
|
||||
hists = hists.Where(hist => hist.Status == EnvelopeStatus.DocumentSigned);
|
||||
|
||||
if (notification.ReceiverSignature is string signature)
|
||||
hists = hists.Where(hist => hist.Receiver!.Signature == signature);
|
||||
// envelope ID filter
|
||||
if (notification.EnvelopeId is int envelopeId)
|
||||
hists = hists.Where(hist => hist.EnvelopeId == envelopeId);
|
||||
|
||||
// envelope UUID filter
|
||||
if (notification.EnvelopeUuid is string envelopeUuid)
|
||||
hists = hists.Where(hist => hist.Envelope!.Uuid == envelopeUuid);
|
||||
|
||||
// receiver ID filter
|
||||
if (notification.ReceiverId is int receiverId)
|
||||
hists = hists.Where(hist => hist.Receiver!.Id == receiverId);
|
||||
|
||||
// receiver signature filter
|
||||
if (notification.ReceiverSignature is string receiverSignature)
|
||||
hists = hists.Where(hist => hist.Receiver!.Signature == receiverSignature);
|
||||
|
||||
return hists;
|
||||
}, cancel);
|
||||
|
||||
Reference in New Issue
Block a user