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:
@@ -61,13 +61,16 @@ public static class DependencyInjection
|
|||||||
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
|
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
|
||||||
|
|
||||||
// Register SignCommand pipeline behaviors in execution order
|
// 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>();
|
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>();
|
cfg.AddBehavior<IPipelineBehavior<SignCommand, Unit>, DocStatusBehavior>();
|
||||||
|
|
||||||
// 3. HistoryBehavior - Records history (executes third)
|
// 3. HistoryBehavior - Records history (executes fourth)
|
||||||
cfg.AddBehavior<IPipelineBehavior<SignCommand, Unit>, HistoryBehavior>();
|
cfg.AddBehavior<IPipelineBehavior<SignCommand, Unit>, HistoryBehavior>();
|
||||||
|
|
||||||
// 4. SendSignedMailBehavior - Sends notification email (executes LAST, only if all previous succeed)
|
// 4. SendSignedMailBehavior - Sends notification email (executes LAST, only if all previous succeed)
|
||||||
|
|||||||
Reference in New Issue
Block a user