Foodtruck Order — TypeScript Reference - v0.1.0
    Preparing search index...
    • The complete kitchen slip for one active order.

      The slip is the glanceable unit of the kitchen queue: the optional queue number, every item the operator must cook, the optional note, the fulfillment state, and the fast forward control. Nothing here is collapsed, abbreviated, or hidden behind an interaction, so the next order is understandable at a glance and to assistive technology alike.

      An absent queue number renders nothing at all in the number position, so no placeholder or fabricated value can be mistaken for a real number, and the internal order identity is never presented as one.

      Item labels come from the immutable snapshots finalization captured. Finalization resolves the operator's optional kitchen label to the product name when none was set, so the slip shows the label that was in force when the order was finalized; a later catalog rename, relabel, or deletion cannot change what the kitchen is asked to cook.

      A quantity of one is omitted; larger quantities are explicit. A single unit is the ordinary case and needs no number, while anything above one is always spelled out so the operator cannot cook the wrong amount.

      The forward control is offered for every active state, and it is always the one valid operation. A queued slip starts preparing, a preparing slip becomes ready, and a ready slip is handed over — after which the order leaves the queue entirely and this slip stops existing rather than showing a spent or disabled control. The control is named after what it does, so the operator never has to infer the next state from an icon.

      The explicit state selector is the deliberate alternative to those fast controls. Alongside them, one named control opens KitchenStateOptions, which lists every operation this order may perform by name and marks the states it may not enter. Both surfaces render the same stateOperationsByStatus policy and call the same callbacks, so the selector can never offer a transition the fast controls would refuse, and it is never a general state editor.

      Parameters

      • __namedParameters: {
            advancing?: boolean;
            onAdvance?: (order: ActiveOrder) => void;
            onCorrect?: (order: ActiveOrder) => void;
            onMetadataChange?: (
                order: ActiveOrder,
                queueNumber: string,
                note: string,
            ) => void;
            onRefund?: (order: ActiveOrder, input: RefundReasonInput) => void;
            onResolveRefund?: (order: ActiveOrder, operationId: string) => void;
            order: ActiveOrder;
            refundError?: boolean;
            refundOperation?: RefundOperation;
            refundPending?: boolean;
            refundResolutionError?: boolean;
            refundResolving?: boolean;
        }
        • Optionaladvancing?: boolean

          True while this order's own advance request is in flight.

        • OptionalonAdvance?: (order: ActiveOrder) => void

          Called for the one valid forward operation; omitted when no advance is possible.

        • OptionalonCorrect?: (order: ActiveOrder) => void

          Called for the one valid backward correction, when this state has one.

        • OptionalonMetadataChange?: (order: ActiveOrder, queueNumber: string, note: string) => void
        • OptionalonRefund?: (order: ActiveOrder, input: RefundReasonInput) => void

          Request a full refund after the detailed menu's explicit confirmation.

        • OptionalonResolveRefund?: (order: ActiveOrder, operationId: string) => void

          Resolve one pending operation through status-only lookup.

        • order: ActiveOrder
        • OptionalrefundError?: boolean

          True when this order's refund request failed at the HTTP boundary.

        • OptionalrefundOperation?: RefundOperation

          Latest refund response, used until the active queue read catches up.

        • OptionalrefundPending?: boolean

          True while this order's request is issuing its refund.

        • OptionalrefundResolutionError?: boolean

          True when this order's status-only resolution failed at the HTTP boundary.

        • OptionalrefundResolving?: boolean

          True while this order's status-only resolution is in flight.

      Returns ReactElement