From d59aa6157d28e85e114e2ea5fa99c0e0b938bd39 Mon Sep 17 00:00:00 2001 From: TekH Date: Tue, 9 Jun 2026 22:47:08 +0200 Subject: [PATCH] Rename SignCommand to SigningCommand across codebase Updated all references to `SignCommand` to use the new `SigningCommand` name for consistency and clarity. This includes changes to class definitions, method signatures, and pipeline behaviors in the following files: - `DependencyInjection.cs`: Updated pipeline behaviors to use `SigningCommand`. - `AnnotationBehavior.cs`: Updated class definition and methods to use `SigningCommand`. Marked `SignCommand` as `[Obsolete]`. - `DocStatusBehavior.cs`, `EnvelopeReceiverResolutionBehavior.cs`, `HistoryBehavior.cs`, `SendSignedMailBehavior.cs`: Updated class definitions and methods to use `SigningCommand`. - `SendSignedMailBehavior.cs`: Updated `CreatePlaceHolders` method to accept `SigningCommand`. - `SigningCommand.cs`: Renamed `SignCommand` record to `SigningCommand` and updated internal methods and properties. Renamed `SignCommandHandler` to `SigningCommandHandler`. Marked `SignCommand` as `[Obsolete]` where applicable to indicate deprecation. These changes improve code readability and align the command name with its purpose in the signing process. --- EnvelopeGenerator.Application/DependencyInjection.cs | 10 +++++----- .../Signatures/Behaviors/AnnotationBehavior.cs | 4 ++-- .../Signatures/Behaviors/DocStatusBehavior.cs | 4 ++-- .../Behaviors/EnvelopeReceiverResolutionBehavior.cs | 4 ++-- .../Signatures/Behaviors/HistoryBehavior.cs | 4 ++-- .../Signatures/Behaviors/SendSignedMailBehavior.cs | 6 +++--- .../Commands/{SignCommand.cs => SigningCommand.cs} | 6 +++--- 7 files changed, 19 insertions(+), 19 deletions(-) rename EnvelopeGenerator.Application/Signatures/Commands/{SignCommand.cs => SigningCommand.cs} (86%) diff --git a/EnvelopeGenerator.Application/DependencyInjection.cs b/EnvelopeGenerator.Application/DependencyInjection.cs index ba534ae2..5f972325 100644 --- a/EnvelopeGenerator.Application/DependencyInjection.cs +++ b/EnvelopeGenerator.Application/DependencyInjection.cs @@ -62,19 +62,19 @@ public static class DependencyInjection // Register SignCommand pipeline behaviors in execution order // 0. EnvelopeReceiverResolutionBehavior - Resolves EnvelopeReceiver from query parameters (executes FIRST) - cfg.AddBehavior, EnvelopeReceiverResolutionBehavior>(); + cfg.AddBehavior, EnvelopeReceiverResolutionBehavior>(); // 1. AnnotationBehavior - Saves annotations (executes second) - cfg.AddBehavior, AnnotationBehavior>(); + cfg.AddBehavior, AnnotationBehavior>(); // 2. DocStatusBehavior - Creates document status (executes third) - cfg.AddBehavior, DocStatusBehavior>(); + cfg.AddBehavior, DocStatusBehavior>(); // 3. HistoryBehavior - Records history (executes fourth) - cfg.AddBehavior, HistoryBehavior>(); + cfg.AddBehavior, HistoryBehavior>(); // 4. SendSignedMailBehavior - Sends notification email (executes LAST, only if all previous succeed) - cfg.AddBehavior, SendSignedMailBehavior>(); + cfg.AddBehavior, SendSignedMailBehavior>(); }); return services; diff --git a/EnvelopeGenerator.Application/Signatures/Behaviors/AnnotationBehavior.cs b/EnvelopeGenerator.Application/Signatures/Behaviors/AnnotationBehavior.cs index d5c857b2..ba418143 100644 --- a/EnvelopeGenerator.Application/Signatures/Behaviors/AnnotationBehavior.cs +++ b/EnvelopeGenerator.Application/Signatures/Behaviors/AnnotationBehavior.cs @@ -11,7 +11,7 @@ namespace EnvelopeGenerator.Application.Signatures.Behaviors; /// Executes first in the signing process. /// [Obsolete("This notification is deprecated. Use Signature.Commands.SignCommand instead.")] -public class AnnotationBehavior : IPipelineBehavior +public class AnnotationBehavior : IPipelineBehavior { private readonly IRepository _repo; @@ -31,7 +31,7 @@ public class AnnotationBehavior : IPipelineBehavior /// /// /// - public async Task Handle(SignCommand request, RequestHandlerDelegate next, CancellationToken cancellationToken) + public async Task Handle(SigningCommand request, RequestHandlerDelegate next, CancellationToken cancellationToken) { if (request.PsPdfKitAnnotation is PsPdfKitAnnotation annot) await _repo.CreateAsync(annot.Structured, cancellationToken); diff --git a/EnvelopeGenerator.Application/Signatures/Behaviors/DocStatusBehavior.cs b/EnvelopeGenerator.Application/Signatures/Behaviors/DocStatusBehavior.cs index 62f23784..33383f8f 100644 --- a/EnvelopeGenerator.Application/Signatures/Behaviors/DocStatusBehavior.cs +++ b/EnvelopeGenerator.Application/Signatures/Behaviors/DocStatusBehavior.cs @@ -11,7 +11,7 @@ namespace EnvelopeGenerator.Application.Signatures.Behaviors; /// Pipeline behavior that creates document status. /// Executes second in the signing process. /// -public class DocStatusBehavior : IPipelineBehavior +public class DocStatusBehavior : IPipelineBehavior { private const string BlankAnnotationJson = "{}"; @@ -34,7 +34,7 @@ public class DocStatusBehavior : IPipelineBehavior /// /// [Obsolete("This notification is deprecated. Use Signature.Commands.SignCommand instead.")] - public async Task Handle(SignCommand request, RequestHandlerDelegate next, CancellationToken cancellationToken) + public async Task Handle(SigningCommand request, RequestHandlerDelegate next, CancellationToken cancellationToken) { await _sender.Send(new CreateDocStatusCommand() { diff --git a/EnvelopeGenerator.Application/Signatures/Behaviors/EnvelopeReceiverResolutionBehavior.cs b/EnvelopeGenerator.Application/Signatures/Behaviors/EnvelopeReceiverResolutionBehavior.cs index c90603e3..d83db5e7 100644 --- a/EnvelopeGenerator.Application/Signatures/Behaviors/EnvelopeReceiverResolutionBehavior.cs +++ b/EnvelopeGenerator.Application/Signatures/Behaviors/EnvelopeReceiverResolutionBehavior.cs @@ -15,7 +15,7 @@ namespace EnvelopeGenerator.Application.Signatures.Behaviors; /// Executes FIRST in the signing process - before all other behaviors. /// If EnvelopeReceiver is not provided, it queries the database using EnvelopeReceiverQueryBase parameters. /// -public class EnvelopeReceiverResolutionBehavior : IPipelineBehavior +public class EnvelopeReceiverResolutionBehavior : IPipelineBehavior { private readonly IRepository _erRepo; private readonly IMapper _mapper; @@ -38,7 +38,7 @@ public class EnvelopeReceiverResolutionBehavior : IPipelineBehavior /// /// - public async Task Handle(SignCommand request, RequestHandlerDelegate next, CancellationToken cancellationToken) + public async Task Handle(SigningCommand request, RequestHandlerDelegate next, CancellationToken cancellationToken) { // If EnvelopeReceiver is not provided, query it from database if (request.EnvelopeReceiver is null) diff --git a/EnvelopeGenerator.Application/Signatures/Behaviors/HistoryBehavior.cs b/EnvelopeGenerator.Application/Signatures/Behaviors/HistoryBehavior.cs index a496aeba..2d46c7b3 100644 --- a/EnvelopeGenerator.Application/Signatures/Behaviors/HistoryBehavior.cs +++ b/EnvelopeGenerator.Application/Signatures/Behaviors/HistoryBehavior.cs @@ -10,7 +10,7 @@ namespace EnvelopeGenerator.Application.Signatures.Behaviors; /// Pipeline behavior that records history. /// Executes third in the signing process. /// -public class HistoryBehavior : IPipelineBehavior +public class HistoryBehavior : IPipelineBehavior { private readonly ISender _sender; @@ -30,7 +30,7 @@ public class HistoryBehavior : IPipelineBehavior /// /// /// - public async Task Handle(SignCommand request, RequestHandlerDelegate next, CancellationToken cancellationToken) + public async Task Handle(SigningCommand request, RequestHandlerDelegate next, CancellationToken cancellationToken) { if (request.EnvelopeReceiver.Receiver is null) throw new InvalidOperationException($"Receiver information is missing in the notification. SignCommand:\n {request.ToJson(Format.Json.ForDiagnostics)}"); diff --git a/EnvelopeGenerator.Application/Signatures/Behaviors/SendSignedMailBehavior.cs b/EnvelopeGenerator.Application/Signatures/Behaviors/SendSignedMailBehavior.cs index 7b951124..d9c9c7f6 100644 --- a/EnvelopeGenerator.Application/Signatures/Behaviors/SendSignedMailBehavior.cs +++ b/EnvelopeGenerator.Application/Signatures/Behaviors/SendSignedMailBehavior.cs @@ -17,7 +17,7 @@ namespace EnvelopeGenerator.Application.Signatures.Behaviors; /// Pipeline behavior that sends signed mail notification. /// Executes LAST in the signing process - only if all previous behaviors succeed. /// -public class SendSignedMailBehavior : IPipelineBehavior +public class SendSignedMailBehavior : IPipelineBehavior { private readonly IRepository _tempRepo; private readonly IRepository _emailOutRepo; @@ -50,7 +50,7 @@ public class SendSignedMailBehavior : IPipelineBehavior /// /// /// - public async Task Handle(SignCommand request, RequestHandlerDelegate next, CancellationToken cancellationToken) + public async Task Handle(SigningCommand request, RequestHandlerDelegate next, CancellationToken cancellationToken) { var placeHolders = CreatePlaceHolders(request); @@ -82,7 +82,7 @@ public class SendSignedMailBehavior : IPipelineBehavior return await next(cancellationToken); } - private Dictionary CreatePlaceHolders(SignCommand request) + private Dictionary CreatePlaceHolders(SigningCommand request) { var placeHolders = new Dictionary() { diff --git a/EnvelopeGenerator.Application/Signatures/Commands/SignCommand.cs b/EnvelopeGenerator.Application/Signatures/Commands/SigningCommand.cs similarity index 86% rename from EnvelopeGenerator.Application/Signatures/Commands/SignCommand.cs rename to EnvelopeGenerator.Application/Signatures/Commands/SigningCommand.cs index 64f99a5f..8ea08c6b 100644 --- a/EnvelopeGenerator.Application/Signatures/Commands/SignCommand.cs +++ b/EnvelopeGenerator.Application/Signatures/Commands/SigningCommand.cs @@ -8,7 +8,7 @@ namespace EnvelopeGenerator.Application.Signatures.Commands; /// /// Command to sign a document by a receiver. /// -public record SignCommand : EnvelopeReceiverQueryBase, IRequest +public record SigningCommand : EnvelopeReceiverQueryBase, IRequest { private EnvelopeReceiverDto? _envelopeReceiver; @@ -37,7 +37,7 @@ public record SignCommand : EnvelopeReceiverQueryBase, IRequest /// Handles the sign command. All work is done by pipeline behaviors. /// This handler is intentionally empty - behaviors handle all the processing. /// -public class SignCommandHandler : IRequestHandler +public class SignCommandHandler : IRequestHandler { /// /// Executes the signing command. Pipeline behaviors handle all processing. @@ -45,7 +45,7 @@ public class SignCommandHandler : IRequestHandler /// /// /// - public Task Handle(SignCommand request, CancellationToken cancellationToken = default) + public Task Handle(SigningCommand request, CancellationToken cancellationToken = default) { return Task.CompletedTask; }