feat(SaveDocStatusCommand): add IMediator extension methods for saving and signing document status
- Introduced `SaveDocStatusAsync` extension method on IMediator to simplify saving document status - Added `SignDocAsync` extension method as a shortcut for signing document status - Refactored `SaveDocStatusCommand` usage to support new mediator extension
This commit is contained in:
parent
20b6b328f5
commit
fb7fd47a2a
@ -13,6 +13,37 @@ namespace EnvelopeGenerator.Application.DocStatus.Commands;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public record SaveDocStatusCommand : ModifyDocStatusCommandBase, IRequest<int?>;
|
public record SaveDocStatusCommand : ModifyDocStatusCommandBase, IRequest<int?>;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static class Extensions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mediator"></param>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="value"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static Task<int?> SaveDocStatusAsync(this IMediator mediator, string key, string? value = null)
|
||||||
|
{
|
||||||
|
return mediator.Send(new SaveDocStatusCommand()
|
||||||
|
{
|
||||||
|
Key = key,
|
||||||
|
Value = value
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mediator"></param>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="value"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static Task<int?> SignDocAsync(this IMediator mediator, string key, string value) => mediator.SaveDocStatusAsync(value);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user