OnOrderPlan
This hook runs after the OnOrderCommands hook and any commands it returned have been applied to the Order Actor, and before the OnOrderCalculate hook.
It is intended for fulfillment planning — inventory routing, source assignment, fulfillment splits, carrier planning — that must settle before derived financial calculations run. Its output is in turn visible to OnOrderCalculate rules, so a tax app, for example, calculates against the fully planned order.
Commands returned from this hook are applied to the order, but do not re-trigger OnOrderCommands, OnOrderPlan, OnOrderCalculate or OnOrderValidate. The hook runs once per message.
Type
filtrera
{
hook: 'OnOrderPlan'
before: Order // The order before the incoming message commands were applied
order: Order // The order after OnOrderCommands has run
}Effects
validationError
Reverts the order state and returns the error to the caller. messageActor
Sends a message to another actor. Responses are ignored. scheduleJob
Schedules a job. sendEmail
Queues an email for delivery through the Sendings system. orderCommand
Applies a command to the order. Commands returned from OnOrderPlan do not re-trigger OnOrderCommands, OnOrderPlan, OnOrderCalculate or OnOrderValidate.