Documentation Index
Fetch the complete documentation index at: https://mintlify.com/teofilobetancourt/Restaurant-Equis/llms.txt
Use this file to discover all available pages before exploring further.
The Orders module is the supervisory view for all transactions recorded in Restaurant Equis. It loads the complete order history from the database, provides status-based filtering and count cards, and lets supervisors drill into any individual ticket to see a full itemised breakdown — including IVA — and, where applicable, cancel orders that have not yet been completed.
Order List
On mount, the view calls GET /api/ordenes to fetch all orders across all statuses. Each row in the list displays:
| Column | Source field |
|---|
| Ticket number | id_pedido (monospace, e.g. #42) |
| Creation time | hora_creacion |
| Customer name | cliente_nombre |
| Order type | tipo — rendered as 🪑 Mesa, 🛍️ Para Llevar, or 🛵 Delivery |
| Total | total (formatted as $XX.XX) |
| Status badge | Estatus_Orden — colour-coded badge |
Rows are clickable and expand inline to show the full order detail.
Filtering
Three status count cards appear above the list. Each card displays the count of orders in that status and acts as a toggle filter — clicking it shows only orders with that status; clicking again clears the filter.
| Status | Badge colour |
|---|
| Recibido | Grey / neutral |
| Preparando | Amber |
| Listo | Green |
A row of quick-filter buttons below the cards lets supervisors switch between Todos, Recibido, Preparando, and Listo in one tap. The button for the active filter is highlighted in the primary colour.
Order Detail
Clicking any order row expands an inline detail panel showing:
- Customer info: cédula, phone number, table number (for mesa orders), or delivery address (for delivery orders)
- Items table: product name, any special notes, quantity, unit price, and line subtotal
- Totals footer: IVA (16%) and grand total
Example detail breakdown:
| Item | Qty | Unit Price | Subtotal |
|---|
| Pabellón Criollo | 2 | $12.50 | $25.00 |
| Jugo de Parchita | 1 | $4.00 | $4.00 |
| — | — | IVA (16%) | $4.64 |
| — | — | Total | $33.64 |
Cancelling an Order
Orders whose status is not Listo show a red Cancelar pedido button at the bottom of their detail panel (this includes Recibido, Preparando, and Entregado). Clicking it prompts a browser confirmation dialog before proceeding:
¿Cancelar el pedido #42 de JUAN PEREZ? Esta acción no se puede deshacer.
If confirmed, the frontend calls:
DELETE /api/ordenes/{id_pedido}
The backend cascades the deletion to the associated factura and detalle_pedido records in PostgreSQL. The order is immediately removed from the list in the UI and a success toast is shown.
Cancelling an order is permanent and irreversible. The deletion cascades to the invoice (factura) and order line items (detalle_pedido) tables. There is no soft-delete or undo mechanism. Only cancel orders that were placed in error or that the customer has explicitly withdrawn.
Order Statuses
| Status value | Meaning |
|---|
Recibido | Order has been submitted from the POS and is waiting for the kitchen to start preparation. |
Preparando | The kitchen has acknowledged the order and is actively preparing it. |
Listo | Preparation is complete; the order is ready for the customer to collect or for a runner to deliver. Cannot be cancelled from this view. |
Entregado | The order has been handed to the customer or dispatched. This is the terminal status and indicates the transaction is fully closed. |