SS Restaurant models the dining room as a set of mesas (tables), each with a live status that reflects its real-world condition. On top of that, the reservation system lets guests book a specific table in advance — or have one auto-assigned — and allows staff to convert confirmed reservations into active orders with a single API call. Conflict detection runs on every reservation write to prevent double-booking.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.
Table states
Every table carries exactly one of three states at any given moment.| State | Colour in UI | Meaning |
|---|---|---|
libre | Green | Table is clean and unoccupied; can accept a new order or reservation |
ocupada | Red | An active order (status pendiente, preparando, or listo) is running on this table |
mantenimiento | Amber | Table is out of service (cleaning, repairs, event setup); excluded from auto-assignment |
ocupada automatically when an order is created and back to libre when an order is delivered or cancelled. Staff can also override the state manually via the quick-status panel in the Tables view.
Table management
Full CRUD is available under/api/tables. All routes require authentication.
| Method | Path | Description |
|---|---|---|
GET | /api/tables | List all tables |
GET | /api/tables/disponibles | List only tables with estado = 'libre' |
GET | /api/tables/:id | Get a single table |
POST | /api/tables | Create a table |
PUT | /api/tables/:id | Full update — number, capacity, and state |
PATCH | /api/tables/:id/estado | Status-only update |
DELETE | /api/tables/:id | Delete a table |
estado values: libre, ocupada, mantenimiento. Any other value returns 400.
Reservation workflow
Create a reservation
POST to
/api/reservations (authenticated staff) or POST /api/public/reservations (no auth required — for online booking forms). Required fields: mesa_id, fecha_hora_inicio, fecha_hora_fin, cantidad_personas. The system runs conflict detection before inserting. Initial estado is always pendiente.Confirm the reservation
When the restaurant acknowledges the booking, patch the state to
confirmada:Convert to an active order
When the guests arrive, convert the reservation to a live order. This marks the reservation The response includes the new order ID:
completada, marks the table ocupada, and creates the pedido in a single transaction:The reservation must be in
confirmada or pendiente state. Attempting to convert a cancelada or completada reservation returns 400. This endpoint requires admin, mesero, or cajero role.Public reservation endpoint
The public endpoint is mounted at/api/public/reservations and requires no authentication. It is designed for embedding on the restaurant’s website or a customer-facing booking widget. When a reservation is submitted, a cliente record is created automatically using the provided nombre and telefono.
| Field | Required | Notes |
|---|---|---|
nombre | ✅ | Used to create a cliente record automatically |
telefono | ✅ | Used to create a cliente record automatically |
fecha_hora_inicio | ✅ | ISO-like datetime string YYYY-MM-DDTHH:mm |
fecha_hora_fin | ✅ | ISO-like datetime string YYYY-MM-DDTHH:mm |
cantidad_personas | ✅ | Minimum seating required |
mesa_id | Optional | If omitted, the system auto-assigns the smallest available table with sufficient capacity |
email | Optional | Stored on the customer record |
observaciones | Optional | Notes passed to the reservation |
mesa_id is omitted and no suitable table is free in the requested window, the API responds with 400 No hay mesas disponibles en ese horario.
Conflict detection
checkTableAvailability runs before every reservation insert or update. It queries for overlapping active reservations:
409 La mesa ya esta reservada en ese horario. When updating an existing reservation the current reservation’s ID is excluded from the conflict check.
Querying available tables
UseGET /api/reservations/mesas-disponibles to get a list of tables that are free for a given time window and have enough capacity. All three parameters are mandatory.
estado = 'mantenimiento' are excluded from results.
Reservation states
| State | Description |
|---|---|
pendiente | Created but not yet acknowledged by staff |
confirmada | Staff has confirmed the booking |
cancelada | Cancelled by staff or guest; releases the table if no active orders exist |
completada | Converted to an order or manually closed |
no_asistio | Auto-assigned by a scheduled check when fecha_hora_fin passes without the reservation being converted |