A simple type-safe finite state machine. This is used internally to control the Order process, ensuring that the state of Orders, Payments, Fulfillments and Refunds follows a well-defined behaviour.
TT(state: T, data: Data) => Promise<{ finalize: () => Promise<any> }>(state: T) => () => readonly T[](state: T) => boolean