Skip to main content

DefaultStockAllocationStrategy

DefaultStockAllocationStrategy

Allocates stock when the Order transitions from ArrangingPayment to either PaymentAuthorized or PaymentSettled.

Signature
class DefaultStockAllocationStrategy implements StockAllocationStrategy {
shouldAllocateStock(ctx: RequestContext, fromState: OrderState, toState: OrderState, order: Order) => boolean | Promise<boolean>;
}

shouldAllocateStock

method
(ctx: RequestContext, fromState: OrderState, toState: OrderState, order: Order) => boolean | Promise<boolean>