kitchen-dal/docs/architecture/kitchen-ticket-store.md
2026-03-31 18:08:53 -06:00

43 lines
1.2 KiB
Markdown

# Kitchen Ticket Store
Related Master Plan: `plan/2026-03-31-s44-master-shared-restaurant-lifecycle.md`
## Purpose
`kitchen-dal` persists kitchen work items and ticket history while preserving the restaurant identifiers that link kitchen execution back to the shared order/check lifecycle.
## Persisted Shapes
### Kitchen Work Item
Each stored work item keeps:
- `ContextId`
- `WorkItemId`
- `OrderId`
- `CheckId`
- `TableId`
- `WorkType`
- `Station`
- `Priority`
- `RequestedAtUtc`
- `State`
- `ClaimedBy`
### Work Item Event History
The DAL also stores event history per work item so kitchen and restaurant-facing projections can show how a ticket progressed over time.
## Query Shape
The DAL exposes internal access patterns for:
- load one kitchen work item by context and work item id
- list queued work items by context
- list work items for a restaurant order
- append and list work-item events
## Ownership Boundary
- `kitchen-domain` owns the ticket lifecycle rules and order-link integrity.
- `kitchen-dal` owns durable storage for ticket progression and ticket event history.
- `operations-dal` remains the source of truth for the restaurant order/check record itself.