Kaizen
Browse modulesBookingsbookings/sharedInterfaces

Interface: BookingMachine<Shape, Event *extends* `string`>

Defined in: shared/bookings/capabilities/compose.ts:61

Type Parameters

Type Parameter
Shape
Event extends string

Properties

capabilities

readonly capabilities: readonly string[];

Defined in: shared/bookings/capabilities/compose.ts:62


definition

readonly definition: AnyStateMachine;

Defined in: shared/bookings/capabilities/compose.ts:65

The generated flat XState machine — Stately-exportable per vertical.


transitions

readonly transitions: readonly Transition<Shape, Event>[];

Defined in: shared/bookings/capabilities/compose.ts:63

Methods

can()

can(
   from: 
  | "draft"
  | "held"
  | "pending"
  | "waitlisted"
  | "offered"
  | "confirmed"
  | "completed"
  | "no_show"
  | "cancelled"
  | "rejected"
  | "expired", 
   event: Event, 
   host: Shape, 
   ctx: TransitionContext
): boolean;

Defined in: shared/bookings/capabilities/compose.ts:67

True if event is legal from from and its structural guard passes.

Parameters

ParameterType
from| "draft" | "held" | "pending" | "waitlisted" | "offered" | "confirmed" | "completed" | "no_show" | "cancelled" | "rejected" | "expired"
eventEvent
hostShape
ctxTransitionContext

Returns

boolean


next()

next(
   from: 
  | "draft"
  | "held"
  | "pending"
  | "waitlisted"
  | "offered"
  | "confirmed"
  | "completed"
  | "no_show"
  | "cancelled"
  | "rejected"
  | "expired", 
   event: Event, 
   host: Shape, 
   ctx: TransitionContext
): 
  | "draft"
  | "held"
  | "pending"
  | "waitlisted"
  | "offered"
  | "confirmed"
  | "completed"
  | "no_show"
  | "cancelled"
  | "rejected"
  | "expired";

Defined in: shared/bookings/capabilities/compose.ts:74

Resolve the target state or throw InvalidTransitionError.

Parameters

ParameterType
from| "draft" | "held" | "pending" | "waitlisted" | "offered" | "confirmed" | "completed" | "no_show" | "cancelled" | "rejected" | "expired"
eventEvent
hostShape
ctxTransitionContext

Returns

| "draft" | "held" | "pending" | "waitlisted" | "offered" | "confirmed" | "completed" | "no_show" | "cancelled" | "rejected" | "expired"

On this page