- 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.
37 lines
994 B
C#
37 lines
994 B
C#
using MediatR;
|
|
|
|
namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="EnvelopeId"></param>
|
|
/// <param name="ReceiverId"></param>
|
|
/// <param name="EnvelopeUuid"></param>
|
|
/// <param name="ReceiverSignature"></param>
|
|
public record RemoveSignatureNotification(
|
|
int? EnvelopeId = null,
|
|
int? ReceiverId = null,
|
|
string? EnvelopeUuid = null,
|
|
string? ReceiverSignature = null
|
|
) : 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.");
|
|
}
|
|
} |