From fb7fd47a2a259c3ad624327ca123df330dc3e500 Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 25 Aug 2025 15:43:54 +0200 Subject: [PATCH] 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 --- .../Commands/SaveDocStatusCommand.cs | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/EnvelopeGenerator.Application/DocStatus/Commands/SaveDocStatusCommand.cs b/EnvelopeGenerator.Application/DocStatus/Commands/SaveDocStatusCommand.cs index 2cd4eb1e..65044a2b 100644 --- a/EnvelopeGenerator.Application/DocStatus/Commands/SaveDocStatusCommand.cs +++ b/EnvelopeGenerator.Application/DocStatus/Commands/SaveDocStatusCommand.cs @@ -13,6 +13,37 @@ namespace EnvelopeGenerator.Application.DocStatus.Commands; /// public record SaveDocStatusCommand : ModifyDocStatusCommandBase, IRequest; +/// +/// +/// +public static class Extensions +{ + /// + /// + /// + /// + /// + /// + /// + public static Task SaveDocStatusAsync(this IMediator mediator, string key, string? value = null) + { + return mediator.Send(new SaveDocStatusCommand() + { + Key = key, + Value = value + }); + } + + /// + /// + /// + /// + /// + /// + /// + public static Task SignDocAsync(this IMediator mediator, string key, string value) => mediator.SaveDocStatusAsync(value); +} + /// /// ///