From 1569647b60cde4843a95477d209ce5276ca65a94 Mon Sep 17 00:00:00 2001 From: TekH Date: Tue, 9 Jun 2026 22:43:37 +0200 Subject: [PATCH] Update pipeline behaviors for SignCommand in MediatR Added EnvelopeReceiverResolutionBehavior as the first pipeline behavior for SignCommand. Updated execution order of existing behaviors: AnnotationBehavior (2nd), DocStatusBehavior (3rd), and HistoryBehavior (4th). SendSignedMailBehavior remains last. Updated comments to reflect the new execution order. --- EnvelopeGenerator.Application/DependencyInjection.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/EnvelopeGenerator.Application/DependencyInjection.cs b/EnvelopeGenerator.Application/DependencyInjection.cs index 35a49835..ba534ae2 100644 --- a/EnvelopeGenerator.Application/DependencyInjection.cs +++ b/EnvelopeGenerator.Application/DependencyInjection.cs @@ -61,13 +61,16 @@ public static class DependencyInjection cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly()); // Register SignCommand pipeline behaviors in execution order - // 1. AnnotationBehavior - Saves annotations (executes first) + // 0. EnvelopeReceiverResolutionBehavior - Resolves EnvelopeReceiver from query parameters (executes FIRST) + cfg.AddBehavior, EnvelopeReceiverResolutionBehavior>(); + + // 1. AnnotationBehavior - Saves annotations (executes second) cfg.AddBehavior, AnnotationBehavior>(); - // 2. DocStatusBehavior - Creates document status (executes second) + // 2. DocStatusBehavior - Creates document status (executes third) cfg.AddBehavior, DocStatusBehavior>(); - // 3. HistoryBehavior - Records history (executes third) + // 3. HistoryBehavior - Records history (executes fourth) cfg.AddBehavior, HistoryBehavior>(); // 4. SendSignedMailBehavior - Sends notification email (executes LAST, only if all previous succeed)