OnOrderCalculate
This hook runs after the OnOrderCommands hook and any commands it returned have been applied to the Order Actor, and before the OnOrderValidate hook.
It is intended for derived calculations that depend on the enriched state produced by OnOrderCommands rules — for example calculating tax after another rule has enriched order line prices. Its output is in turn visible to OnOrderValidate rules.
Commands returned from this hook are applied to the order, but do not re-trigger OnOrderCommands, OnOrderCalculate or OnOrderValidate. The hook runs once per message.
Type
filtrera
{
hook: 'OnOrderCalculate'
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 OnOrderCalculate do not re-trigger OnOrderCommands, OnOrderCalculate or OnOrderValidate.