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.
This commit is contained in:
2026-06-09 22:43:37 +02:00
parent 3bb2a013ab
commit 1569647b60

View File

@@ -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<IPipelineBehavior<SignCommand, Unit>, EnvelopeReceiverResolutionBehavior>();
// 1. AnnotationBehavior - Saves annotations (executes second)
cfg.AddBehavior<IPipelineBehavior<SignCommand, Unit>, AnnotationBehavior>();
// 2. DocStatusBehavior - Creates document status (executes second)
// 2. DocStatusBehavior - Creates document status (executes third)
cfg.AddBehavior<IPipelineBehavior<SignCommand, Unit>, DocStatusBehavior>();
// 3. HistoryBehavior - Records history (executes third)
// 3. HistoryBehavior - Records history (executes fourth)
cfg.AddBehavior<IPipelineBehavior<SignCommand, Unit>, HistoryBehavior>();
// 4. SendSignedMailBehavior - Sends notification email (executes LAST, only if all previous succeed)