State machines
Postgres enums constrain the stored value. These maps constrain the edge.
| Aggregate | Source | Page |
|---|---|---|
| Order | two identical files | Order state machine |
| Fulfillment | fulfillment-state-machine.ts | Fulfillment |
| Return | return-state-machine.ts | Returns |
| Purchase order | purchase-order-state-machine.ts | Procurement |
| Goods receipt | goods-receipt-state-machine.ts | Procurement |
| Channel | schema comment plus circuit breaker | Channels |
| Outbox | dispatcher | Async processing |
Order and return helpers return true when the current status is null. Fulfillment does not. Shipment status was not copied into a single map on this page. It is applied in shipment services and courier webhooks.