Every transaction in SS Restaurant begins with a pedido (order). When a waiter opens a new order it is immediately linked to a physical table, optionally to a reservation that exists for that table today, and to the waiter who is serving it. From that moment the order travels through a well-defined service pipeline — kitchen staff advance it toward preparation and delivery, while cashiers handle payment at the end. Every step is recorded in the audit log and triggers a real-time notification to the appropriate role.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/FloresJesus/SS_RESTAURANT/llms.txt
Use this file to discover all available pages before exploring further.
Order status flow
Orders carry two independent status fields:estado_servicio— tracks where the order is in the service pipeline.estado_pago— tracks whether it has been paid (pendiente→pagado).
estado_servicio transitions; the database stores Spanish equivalents.
API value (status) | Database value (estado_servicio) | Meaning |
|---|---|---|
pending | pendiente | Order placed, not yet started in kitchen |
preparing | preparando | Kitchen is actively working on it |
ready | listo | Ready on the pass, waiting for the waiter |
delivered | entregado | Delivered to the table |
cancelled | cancelado | Order voided |
Role permissions
Create orders
Roles admin, mesero, and cajero may call
POST /api/orders.Edit items
Roles admin and mesero may call
PUT /api/orders/:id/items and DELETE /api/orders/:id/items/:itemId.Update status
All authenticated roles can call
PUT /api/orders/:id/status. The Vue frontend additionally enforces per-role transitions: kitchen can advance to preparing, waiters can mark ready, admins can do any transition.Creating an order
Send aPOST request to /api/orders. The mesa_id, mesero_id, and at least one item are required.
| Field | Required | Description |
|---|---|---|
mesa_id | ✅ | ID of the table |
mesero_id | ✅ | ID of the waiter |
items | ✅ | Array with at least one element |
items[].producto_id | ✅ | Product ID from the menu |
items[].cantidad | ✅ | Quantity (integer ≥ 1) |
items[].precio_unitario | Optional | Overrides the current product price if provided |
items[].observaciones | Optional | Per-item notes for kitchen |
cliente_id | Optional | Link to an existing customer record |
reserva_id | Optional | Explicitly link a reservation |
observaciones | Optional | General order notes |
metodo_pago | Optional | Passing a valid payment method here also creates a payment record immediately and marks the order pagado |
Managing order items
UsePUT /api/orders/:id/items to add new products or update quantities on an existing order. Pass each item with either an id (to update an existing detail row) or no id (to insert a new row).
Updating order status
status: pending, preparing, ready, delivered, cancelled.
Successful response:
Automatic behaviors
The order controller performs several side-effects automatically within a single database transaction:- Table occupation — Creating any order sets the table’s
estadoto'ocupada'. - Table liberation — Transitioning to
entregadoorcanceladosets the table back to'libre'. - Reservation detection — If no
reserva_idis supplied, the system queries for aconfirmadaorpendientereservation for that table dated today and links it automatically. - Reservation completion — Once a reservation is linked to a new order, its
estadois updated to'completada'.
Notifications
Every status transition fires acreateNotification call with a destination role:
| Status | Notification destination |
|---|---|
pending | cocina (kitchen) |
preparing | cocina (kitchen) |
ready | mesero (waiter) |
delivered | admin |
Sales statistics
TheGET /api/orders/stats endpoint powers the dashboard charts. Use the optional range query parameter to switch between weekly and monthly views.
When
range=week the day field uses abbreviated day names (Lun, Mar, …). When range=month the day field is the numeric day of the month as a string (“1”, “2”, …).