feat(envelope-reports): add extension method for reading envelope reports via ISender

This commit is contained in:
Developer 02 2025-11-11 19:21:22 +01:00
parent 8459706c45
commit 6f9b5d4b13

View File

@ -27,6 +27,26 @@ public record ReadEnvelopeReportQuery(int EnvelopeId) : IRequest<IEnumerable<Env
public bool ThrowIfNotFound { get; init; } = true;
};
/// <summary>
///
/// </summary>
public static class ReadEnvelopeReportQueryExtensions
{
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="envelopeId"></param>
/// <param name="throwIfNotFound"></param>
/// <param name="cancel"></param>
/// <returns></returns>
public static Task<IEnumerable<EnvelopeReport>> ReadEnvelopeReportAsync(this ISender sender, int envelopeId, bool throwIfNotFound = true, CancellationToken cancel = default)
=> sender.Send(new ReadEnvelopeReportQuery(envelopeId)
{
ThrowIfNotFound = throwIfNotFound
}, cancel);
}
/// <summary>
///
/// </summary>