Order Lifecycle
How orders progress from creation to completion.
Statesโ
PENDING โ IN_PROGRESS โ DELIVERED โ COMPLETED
โ
CANCELLED
| State | Meaning | Entered When | Exits To |
|---|---|---|---|
PENDING | Created, no deliveries yet. Escrow held if charge-on-creation enabled. Visible to all, cancellable (if allowed). | Order created | IN_PROGRESS on first delivery, CANCELLED, or expires |
IN_PROGRESS | Partial deliveries made; deliverers paid for what's delivered so far; still accepting deliveries. | First delivery occurs | DELIVERED when all items in, CANCELLED (may be restricted), or expires |
DELIVERED | All items delivered, deliverers fully paid, awaiting creator collection. | Last item delivered | COMPLETED when fully collected; auto-deleted once collection finishes and payment clears |
COMPLETED | All items collected, all payments processed. | All items collected | Deleted automatically (cleanup) |
CANCELLED | Cancelled by creator or admin; escrow refunded if enabled; no further deliveries. | Cancel action (any prior state) | Deleted (optional, configurable) |
Expirationโ
Governed by order-life (see Order Configuration):
- Periodic check finds expired orders.
- Escrow auto-refunded if enabled.
- Orders with uncollected items are kept (not deleted) until collected.
Concurrencyโ
- Multiple players can deliver to the same order simultaneously.
- Optimistic locking prevents over-delivery.
- All state changes are transactional (DB-safe).
See Alsoโ
- Escrow System - payment handling
- Delivery System - delivery mechanics
- Collection System - collection mechanics
- Order Configuration - expiration, limits, pricing keys