customer-orders-bff/docs/api/customer-order-workflows.md
2026-03-31 19:59:32 -06:00

34 lines
1.6 KiB
Markdown

# Customer Order Workflow API
## Purpose
This BFF exposes customer-facing order submission, status, detail, and history workflows over REST while delegating orchestration to `operations-service`.
## Endpoints
- `GET /api/customer/orders/status?contextId=<value>`
- Returns the current customer order status snapshot.
- `GET /api/customer/orders/history?contextId=<value>`
- Returns the recent customer order history snapshot.
- `GET /api/customer/orders/{orderId}?contextId=<value>`
- Returns the current detail projection for a single order within the active customer context.
- `POST /api/customer/orders`
- Submits a customer order snapshot for processing.
## Upstream Dependency
- Base address configuration: `OperationsService:BaseAddress`
- Default runtime target: `http://operations-service:8080`
- Internal upstream routes:
- `GET /internal/operations/customer/status`
- `GET /internal/operations/customer/orders/{orderId}`
- `GET /internal/operations/customer/history`
- `POST /internal/operations/orders`
## Notes
- Customer order submission currently maps `ItemIds.Count` into the upstream restaurant order workflow because the internal service contract still accepts aggregate item counts.
- Successful submission writes into the same shared restaurant lifecycle later observed by waiter-floor, kitchen-ops, and POS projections.
- Customer detail and history now come from dedicated lifecycle-backed upstream routes instead of projecting everything from the status snapshot.
- Correlation IDs are preserved through Thalos session checks and operations-service calls.