H1Orders
Status: hub for locked commercial snapshots and fulfillment orders.
H2Focus Strip
| Now | Lock | Do Not Break | Next Closure |
|---|---|---|---|
| Final commercial state | order-owned preserved line items | no offer recompute, no total recompute | create order snapshot action + read helper |
| State | Meaning |
|---|---|
| built/locked | basic order CRUD and schema support |
| built/partial | document-to-order bridge and old mapper |
| docs-ahead | immutable order snapshot read/write contract |
This folder maps to the order route group and its actions:
/orders/[orderId]app/orders/actions/orderFromOffer.tsapp/orders/actions/projectOrders.ts
H2Current status
- Order is the downstream locked transaction surface.
- Order creation should snapshot Offer LineItems.
- The order surface is thinner than Trips and Offers, which is correct.
- This folder exists mainly to document snapshot discipline and projection behavior.
H2Code Audit - 2026-04-26
H3Built / locked
getProjectOrders()lists project orders with offer and contact context.createOrder(),updateOrder(), anddeleteOrder()exist as basic order CRUD actions.- Prisma
OrdersupportsofferId,contactId,snapshot,currency,status, and order-owned line items.
H3Built / partial
documentToOrder()can create an order from a document-bound offer.orderFromOffer.tsmaps an older in-memory offer object into an order create shape, but it is not the active Prisma snapshot action.
H3Docs-ahead / pending
- Locked Order snapshot behavior is not complete until order creation clones offer line items without recomputing totals.
- Order reads should expose order-owned line items and snapshot payloads when used for document/export projection.
H3Critical next step
Make Orders the end of the commercial pipeline by adding a canonical offer snapshot creation action and a read helper that returns the order plus preserved line items and snapshot metadata.
H2Canonical files
H2Related hubs
H2Folder rule
- Orders are immutable snapshots of commercial truth.
- No offer recompute belongs here.
- Keep order-specific presentation notes here only when they affect snapshot or export behavior.