Order business rules
Confirmed by code
Implementation behavior
Status changes are accepted only when
VALID_ORDER_TRANSITIONScontains the edge, or when the current status is null. The null case returns true.Status
Enforced in both state-machine files.
Implementation behavior
CANCELLEDcan transition toREFUNDED. Several earlier statuses cannot go directly toREFUNDED. FromRETURN_RECEIVED,PARTIALLY_RETURNED, andRETURNED, refund statuses are allowed. FromPENDINGorCONFIRMED, they are not.Business intent
The repository does not say why
CANCELLEDis the non-return path intoREFUNDED.Status
Requires business confirmation.
Implementation behavior
DISPUTEDcan return toPENDING, and can go toREFUNDEDorCLOSED.Business intent
Whether operators may click that edge, or only a system flow may, is not established.
Status
Requires business confirmation.
Implementation behavior
Create and status writes that need side effects enqueue outbox rows in the same transaction. The worker dispatches them.
Status
Project rule in
AGENTS.mdand the command services that calloutboxWriter.enqueue(tx, ...).
Inferred
- Admin and warehouse do not apply a second state machine. They call the API.
CHANNEL_FULFILLEDdoes not reserve owned stock.resolveFulfillmentModesets that mode for AFN, FBA, and the other partner descriptors infulfillment-mode.util.ts. See What an order status does to fulfillment.
Unknown
- Reservation on create runs only for a
PENDINGorder whose fulfillment mode allocates owned stock (OMS_MANAGEDand any mode other thanCHANNEL_FULFILLEDandVENDOR_DROPSHIP). See What an order status does to fulfillment. - Create-order idempotency key.
- Whether cancelling a partially fulfilled order restocks picked units.
- Which transitions the admin UI offers.
- What a wallet token costs, and whether a failed label refunds it. The debit is on
order.confirmed, which is before the label.