An order in La Previa Restobar is the primary unit of work: it links a table to a list of menu items and tracks the full journey from the moment a waiter submits it to the kitchen through to payment. Each order moves through a defined set of statuses; the status field drives UI state on both the waiter’s Android device and the kitchen display. When an order is confirmed (moves toDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/luisumit/LaPreviaRestobar/llms.txt
Use this file to discover all available pages before exploring further.
ACEPTADO), the inventory subsystem decrements stock for every item that has trackInventory: true.
Order Status Lifecycle
| Status | Meaning |
|---|---|
PENDING | Order created locally, not yet sent to the backend |
ENVIADO | Order sent to the server and visible to kitchen staff |
ACEPTADO | Kitchen has acknowledged and accepted the order |
EN_PREPARACION | Kitchen is actively preparing the dishes |
LISTO | Food is ready for pick-up or delivery to the table |
ENTREGADO | Food has been delivered to the table; table remains occupied |
COMPLETED | Order settled; table can be cleared |
CANCELLED | Order was cancelled before completion |
OrderDto — API Response Fields
The fields below describeOrderDto, the object returned by every orders API endpoint. The Android OrderDto is intentionally lightweight — it carries exactly the fields listed here.
Unique order identifier (UUID or Firebase push key).
Numeric ID of the table this order belongs to.
Human-readable table number shown on receipts and kitchen tickets.
Current order status. One of
PENDING, ENVIADO, ACEPTADO, EN_PREPARACION, LISTO, ENTREGADO, COMPLETED, CANCELLED.Total order amount in local currency. Equal to the sum of all
item.subtotal values.Unix epoch timestamp (milliseconds) when the order was created.
Unix epoch timestamp (milliseconds) of the last status change.
Local model fields: The fieldswaiterId,waiterName,notes,version,syncStatus, anditemsexist on the localOrdermodel (used by Room and the Android ViewModel) but are not part ofOrderDtoand are therefore not returned by the API. Theitemsarray lives in the Firebase document and is populated when the Android client hydrates the record from its local Room cache. TheversionandsyncStatusfields are managed client-side only.
Local Order model — additional fields (not in API response)
These fields are present on theOrder data class used by the Android app after mapping from OrderDto:
ID of the waiter who created the order. May be
null for orders created without an authenticated session.Display name of the waiter, used on kitchen tickets.
Free-text notes from the waiter (e.g.
"sin cebolla", "alergia a mariscos").Optimistic concurrency counter. Incremented on every write.
Local sync state on the Android client. Values:
PENDING, SYNCED, ERROR. Defaults to PENDING.List of ordered items. Each element is an
OrderItem.GET /orders
Returns every order stored in Firebase, regardless of status or table.200 OK
GET /orders/table/{tableId}
Returns all orders associated with a specific table, ordered bycreatedAt descending in the Firebase query.
Path parameters
The numeric table ID to filter by.
200 OK — same shape as GET /orders but scoped to the given table.
POST /orders
Creates a new order and writes it to theorders node in Firebase. The Android client typically calls this after the waiter finishes building the item list and taps “Enviar pedido”.
Request body (CreateOrderDto)
ID of the table for this order.
Pre-calculated total amount. Should equal the sum of
item.unitPrice × item.quantity for all items.List of items to include in the order.
200 OK — returns the newly created OrderDto.
PUT /orders/{id}/status
Advances or changes an order’s status. This is the primary way the kitchen display, waiter app, and cashier all coordinate on a single order. Path parametersThe order’s unique identifier.
OrderStatusUpdateRequest)
The new status value. Must be one of:
PENDING, ENVIADO, ACEPTADO, EN_PREPARACION, LISTO, ENTREGADO, COMPLETED, CANCELLED.200 OK — returns the OrderDto with the updated status and a refreshed updatedAt timestamp.