OrderProcessOptions

OrderProcessOptions

Documentation generated from vendure-config.ts on Feb 19 2019 at 16:20

Signature

interface OrderProcessOptions<T extends string> {
  transtitions?: Partial<Transitions<T | OrderState>>;
  onTransitionStart?(
        fromState: T,
        toState: T,
        data: { order: Order },
    ): boolean | Promise<boolean> | Observable<boolean> | void;
  onTransitionEnd?(fromState: T, toState: T, data: { order: Order }): void;
  onError?(fromState: T, toState: T, message?: string): void;
}

Members

transtitions

property
type:
Partial<Transitions<T | OrderState>>

Define how the custom states fit in with the default order state transitions.

onTransitionStart

method
type:
(fromState: T, toState: T, data: { order: Order }) => boolean | Promise<boolean> | Observable<boolean> | void

Define logic to run before a state tranition takes place. Returning false will prevent the transition from going ahead.

onTransitionEnd

method
type:
(fromState: T, toState: T, data: { order: Order }) => void

Define logic to run after a state transition has taken place.

onError

method
type:
(fromState: T, toState: T, message: string) => void

Define a custom error handler function for transition errors.

alpha