Skip to main content

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.

La Comanda splits every order into two parallel preparation streams. The kitchen handles food items, while the barista handles café and beverage items. Each station has its own dedicated screen and API endpoints, so staff only ever see the items relevant to their role. Both queues are updated in real time as waiters submit orders and staff progress items through preparation.

Routing

Item routing is determined entirely by the category slug of each product. The database view vw_detalle_preparacion pre-calculates an area_preparacion field for every order line so that each station’s API can filter with a simple WHERE clause:
area_preparacionConditionStation
baristacategoria.slug IN ('cafes', 'bebidas')Barista screen
cocinaAny other slug (except mesas)Kitchen screen
ignorarcategoria.slug = 'mesas'Not shown anywhere
No configuration is required — adding a product to a cafes or bebidas category automatically routes it to the barista; everything else goes to the kitchen.

Kitchen Workflow

1

View incoming orders

Kitchen staff open views/cocina.php, which polls:
GET /public/api/obtenerOrdenes.php
The response lists all non-barista orders that contain at least one item not yet marked entregado:
{
  "ok": true,
  "ordenes": [
    {
      "numero": 42,
      "mesa": 3,
      "items": "Sandwich de Pollo x 1\nCheesecake x 3",
      "notas": "Sin gluten",
      "estado_item": "pendiente"
    }
  ]
}
The screen refreshes automatically so new orders appear without a manual reload.
2

Start preparation

When a cook begins working on an order, they click En preparación. This calls:
POST /public/api/cocinaAccion.php
with the body:
{ "numero": 42, "accion": "preparacion" }
All kitchen items in that order move from pendienteen_preparacion.
3

Mark ready

When the food is plated and ready for collection, the cook clicks Listo:
POST /public/api/cocinaAccion.php
{ "numero": 42, "accion": "lista" }
All kitchen items in that order advance to listo. The waiter’s screen reflects the change so they know the food is ready to carry out.
4

Mark delivered

Once the waiter has collected the food, the order can be closed out by calling:
POST /public/api/marcarEntrega.php
{ "numero": 42 }
This marks the entire kitchen sub-order as entregada and, if the barista sub-order is also complete, frees the table back to disponible.

Barista Workflow

1

View barista panel

Barista staff open views/barista.php, which calls:
GET /public/api/baristaEstado.php
The response separates orders into two lists for easy scanning:
{
  "ok": true,
  "pendientes": [
    { "numero": 43, "mesa": 5, "items": "Espresso x 2", "notas": "" }
  ],
  "listas": [
    { "numero": 41, "mesa": 2, "items": "Cappuccino x 1", "notas": "" }
  ]
}
pendientes contains orders not yet started or in preparation; listas contains orders ready for pickup.
2

Start preparation

The barista clicks En preparación to begin making the drinks:
POST /public/api/baristaAccion.php
{ "numero": 43, "accion": "preparacion" }
Only items currently in pendiente state are moved to en_preparacion — items already further along the queue are unaffected.
3

Mark ready

When the drinks are ready, the barista clicks Listo:
POST /public/api/baristaAccion.php
{ "numero": 43, "accion": "lista" }
This action moves both pendiente and en_preparacion items to listo, so a barista can skip straight to ready if needed.

State Transitions

Item states follow a strict progression. The table below shows the permitted transitions and the action that triggers each one:
FromToTriggered by
pendienteen_preparacionaccion=preparacion
en_preparacionlistoaccion=lista
listoentregadoentregarOrden.php or marcarEntrega.php
Barista-specific behaviour:
  • accion=preparacion moves only pendiente items to en_preparacion.
  • accion=lista moves both pendiente and en_preparacion items directly to listo.
This allows a barista to mark a simple drink order as ready in a single action without first clicking En preparación.

Roles

Access to each station’s action endpoints is restricted by role (rol_id):
StationPermitted roles
Kitchen (cocinaAccion.php, marcarEntrega.php)rol_id IN (1, 3) — Admin and Kitchen staff
Barista (baristaAccion.php)rol_id IN (1, 4) — Admin and Barista staff
Attempts to call these endpoints from a role without permission will be rejected by the server.
Admins can also use POST /public/api/adminCambiarEstadoOrden.php to override the status of any order, bypassing the normal state machine.

Build docs developers (and LLMs) love