From af14ef7ce5379332da50c2b3a2ecd072e49caf4a Mon Sep 17 00:00:00 2001 From: TekH Date: Wed, 22 Oct 2025 11:02:10 +0200 Subject: [PATCH] feat(RemoveSignatureNotification): add validation and filter logic to RemoveSignatureNotification - Added `HasFilter` property to check if any filter parameters are provided. - Implemented `ThrowIfHasNoFilter()` method to enforce at least one filter parameter. - Improves robustness and validation of RemoveSignatureNotification. --- .../RemoveSignatureNotification.cs | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/RemoveSignatureNotification.cs b/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/RemoveSignatureNotification.cs index 529a6c4f..4ec849d2 100644 --- a/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/RemoveSignatureNotification.cs +++ b/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/RemoveSignatureNotification.cs @@ -14,4 +14,24 @@ public record RemoveSignatureNotification( int? ReceiverId = null, string? EnvelopeUuid = null, string? ReceiverSignature = null - ) : INotification; \ No newline at end of file + ) : INotification +{ + /// + /// + /// + public bool HasFilter => + EnvelopeId is not null + || ReceiverId is not null + || EnvelopeUuid is not null + || ReceiverSignature is not null; + + /// + /// + /// + /// + public void ThrowIfHasNoFilter() + { + if (!HasFilter) + throw new InvalidOperationException("At least one filter parameter must be provided."); + } +} \ No newline at end of file