Tables are the central unit of activity in La Comanda. Every order is tied to a specific table, and the system keeps each table’s status in sync automatically as orders are created, prepared, and delivered. Admins can also customise the visual floor plan using a drag-and-drop interface, giving each venue a layout that mirrors its physical space.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JAQA20/LaComanda/llms.txt
Use this file to discover all available pages before exploring further.
Table States
Each row in themesas table carries an estado column that reflects whether a table is free or in use. Only two states exist:
| State | Description |
|---|---|
disponible | Table is free and can receive a new order |
ocupada | Table has an active order in progress |
- A table moves to ocupada the moment an order is submitted via
guardarOrden.php. - It returns to disponible once all items in every sub-order (kitchen and barista) have been marked
entregado.
Viewing Table Status
To retrieve the current state of all tables for the logged-in user, call:data is the table number (mesaNumero) as a string. The numero_orden field is null when the table is disponible, and contains the active order number when ocupada. This endpoint is polled by views/index.php to keep the table map up to date in real time.
Floor Layout (Admin Only)
Thelayout_configs table stores the drag-and-drop position of each table icon on the visual floor map. Three endpoints manage this layout:
| Method | Endpoint | Description |
|---|---|---|
GET | /public/api/layoutMesas.php | Returns the current layout positions for all tables |
POST | /public/api/layoutMesas.php | Saves new positions for one or more tables |
DELETE | /public/api/layoutMesas.php | Resets the entire layout back to default positions |
rol_id = 1 (admin) may call the POST and DELETE methods. All authenticated users can read the layout via GET.
Saving a Layout
Send aPOST request with a JSON body containing an items object. Each key is a table identifier string (e.g. "mesa-1") and the value is a coordinate pair:
items are affected.
Layout Coordinate System
Positions are expressed as percentages of the floor-plan container’s width and height, giving the layout a resolution-independent coordinate space. Bothleft and top accept floating-point values and are clamped to the range −2 to 98 before being stored, ensuring table icons remain visible even when dragged to the very edge of the map.
| Property | Type | Range | Description |
|---|---|---|---|
left | float | −2 to 98 | Horizontal position as a percentage of container width |
top | float | −2 to 98 | Vertical position as a percentage of container height |
Default Tables
The database is seeded with 12 tables numbered 1 through 12. All tables start withestado = 'disponible'. The default floor layout arranges these tables in a grid pattern, which admins can freely rearrange through the drag-and-drop interface.
Only admins can modify the floor layout. All authenticated users can read it.