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.
This commit is contained in:
parent
1edcfed318
commit
af14ef7ce5
@ -14,4 +14,24 @@ public record RemoveSignatureNotification(
|
|||||||
int? ReceiverId = null,
|
int? ReceiverId = null,
|
||||||
string? EnvelopeUuid = null,
|
string? EnvelopeUuid = null,
|
||||||
string? ReceiverSignature = null
|
string? ReceiverSignature = null
|
||||||
) : INotification;
|
) : INotification
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool HasFilter =>
|
||||||
|
EnvelopeId is not null
|
||||||
|
|| ReceiverId is not null
|
||||||
|
|| EnvelopeUuid is not null
|
||||||
|
|| ReceiverSignature is not null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="InvalidOperationException"></exception>
|
||||||
|
public void ThrowIfHasNoFilter()
|
||||||
|
{
|
||||||
|
if (!HasFilter)
|
||||||
|
throw new InvalidOperationException("At least one filter parameter must be provided.");
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user