An abstract class which is extended by PromotionItemAction, PromotionOrderAction, and PromotionShippingAction.
ConfigurableOperationDef<T>number0Used to determine the order of application of multiple Promotions
on the same Order. See the Promotion priorityScore field for
more information.
Represents a PromotionAction which applies to individual OrderLines.
Example
PromotionAction<T, U>Represents a PromotionAction which applies to the Order as a whole.
Example
PromotionAction<T, U>Represents a PromotionAction which applies to the shipping cost of an Order.
PromotionAction<T, U>The function which is used by a PromotionItemAction to calculate the discount on the OrderLine for each item.
The function which is used by a PromotionLineAction to calculate the discount on the OrderLine.
The function which is used by a PromotionOrderAction to calculate the discount on the Order.
The function which is used by a PromotionOrderAction to calculate the discount on the Order.
The signature of a PromotionAction's side-effect functions onActivate and onDeactivate.
Configuration for all types of PromotionAction.
ConfigurableOperationDefOptions<T>number0Used to determine the order of application of multiple Promotions
on the same Order. See the Promotion priorityScore field for
more information.
U extends undefined ? undefined : ConditionTuple<Exclude<U, undefined>>Allows PromotionActions to define one or more PromotionConditions as dependencies. Having a PromotionCondition as a dependency has the following consequences:
execute() function will receive a statically-typed state argument which will contain
the return values of the PromotionConditions' check() function.An optional side effect function which is invoked when the promotion becomes active. It can be used for things like adding a free gift to the order or other side effects that are unrelated to price calculations.
If used, make sure to use the corresponding onDeactivate function to clean up
or reverse any side effects as needed.
Used to reverse or clean up any side effects executed as part of the onActivate function.
Configuration for a PromotionItemAction
PromotionActionConfig<T, U>ExecutePromotionItemActionFn<T, U>The function which contains the promotion calculation logic. Should resolve to a number which represents the amount by which to discount the OrderLine, i.e. the number should be negative.
Configuration for a PromotionLineAction
PromotionActionConfig<T, U>ExecutePromotionLineActionFn<T, U>The function which contains the promotion calculation logic. Should resolve to a number which represents the amount by which to discount the OrderLine, i.e. the number should be negative.
PromotionActionConfig<T, U>ExecutePromotionOrderActionFn<T, U>The function which contains the promotion calculation logic. Should resolve to a number which represents the amount by which to discount the Order, i.e. the number should be negative.
PromotionActionConfig<T, U>ExecutePromotionShippingActionFn<T, U>The function which contains the promotion calculation logic. Should resolve to a number which represents the amount by which to discount the Shipping, i.e. the number should be negative.
Represents a PromotionAction which applies to individual OrderLines. The difference from PromotionItemAction is that it applies regardless of the Quantity of the OrderLine.
Example
PromotionAction<T, U>