Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/teofilobetancourt/Tradiciones-y-Sabores/llms.txt

Use this file to discover all available pages before exploring further.

The Kitchen Display System (KDS) is the real-time board that kitchen staff use to manage the flow of active orders. It shows every order currently in recibido or preparando state as an individual card, displays the elapsed time since the order was placed, and lets any cook advance an order through the preparation pipeline with a single confirmation click. An audio alert (three ascending tones) sounds automatically whenever a new order appears on the board, keeping the kitchen aware of incoming work without anyone needing to watch the screen.

Accessing the Kitchen View

Select Cocina from the staff sidebar, or navigate directly:
http://localhost/?view=kitchen
The view auto-refreshes every 30 seconds. Staff can also press Actualizar in the top-right corner to force an immediate reload.

Kitchen Workflow

1

New Order Arrives

When a cashier or a customer submits an order it is persisted with estado_orden = recibido. On the next refresh cycle (or when Actualizar is pressed) a new card appears on the KDS board. If there were fewer cards before the refresh, the audio notification plays and a toast confirms how many active orders are on the board.
2

Start Preparation

Click the ▶ Iniciar preparación button at the bottom of a Recibido card. A confirmation modal appears showing:
  • Order number (#id_pedido)
  • Customer name
  • Table number (for mesa orders)
Confirm to send PUT /api/v1/ordenes/{num_ticket} with Estatus_Orden: "Preparando". The card header immediately changes to the Preparando color scheme.
3

Monitor Elapsed Time

Each card displays a live elapsed timer in the top-right corner (updated every 30 seconds). If an order has been in the Preparando state for 10 minutes or more the card border turns red and pulses to alert kitchen staff that the order may be running late.
4

Dispatch the Order

Click ✓ Despachar on a Preparando card to advance it to Listo. The confirmation modal shows the customer name and table number. Confirm to send PUT /api/v1/ordenes/{num_ticket} with Estatus_Orden: "Listo".A success toast is shown: ”✓ Orden #N lista para entregar — [Customer Name]”.
5

Order Leaves the Board

Once dispatched the card shows a green “Listo para entregar” footer instead of an action button. The order is removed from the active board on the next refresh because the API query filters for recibido and preparando only. The full order history (including listo, entregado, and cancelado orders) is available in the Orders module.

Order Status Transitions

FromActionToAPI Call
recibido▶ Iniciar preparaciónpreparandoPUT /api/v1/ordenes/{id} { "Estatus_Orden": "Preparando" }
preparando✓ DespacharlistoPUT /api/v1/ordenes/{id} { "Estatus_Orden": "Listo" }
listoCard auto-removed from KDS
The KDS only supports advancing orders forward. To cancel an order or view completed/delivered history, use the Orders module, which displays the full order list with cancellation controls.

Order Card Reference

Each card on the KDS board displays the following information:
ElementSource FieldNotes
Order numberid_pedidoDisplayed in large monospace type
Order typetipoMesa + table number, 🛍️ Para Llevar, or 🛵 Delivery
Table numbermesaShown in large bold type for mesa orders
Customer namecliente_nombreShown below the order type
Phonecliente_telefonoShown next to the name in small text
Elapsed timeDerived from hora_creacionRecalculated every 30 s; turns red after 10 min in preparando
Itemsitems[].nombre, items[].cantidadEach line shows Nx Item Name
Special notesitems[].notasShown in a red warning badge below the item name

Visual State Indicators

StateCard BorderHeader BackgroundAction Button
Recibidoborder-outline-variantbg-surface-container-highestbg-primary ▶ Iniciar preparación
Preparandoborder-outline-variantbg-surface-container-highestbg-secondary-container ✓ Despachar
Preparando (≥ 10 min)🔴 Pulsing border-errorbg-error-containerbg-secondary-container ✓ Despachar
Listoborder-emerald-400bg-emerald-50✅ “Listo para entregar” footer (no button)

Audio Notifications

The KDS uses the Web Audio API to play three sequential ascending tones (Do–Mi–Sol, 523 / 659 / 784 Hz, each 120 ms apart) whenever the active order count increases after the first page load. The alert does not play on the initial load — only on subsequent refreshes where the count grows. The sound can be toggled on or off using the Sonido ON / Silencio button in the top toolbar.
Sonido ON  →  Audio alert plays on new orders
Silencio   →  No audio; visual toast still appears
If the browser blocks audio on page load (autoplay policy), the sound will not play until the user has interacted with the page at least once. Ask kitchen staff to click the sound toggle button when they first open the KDS to ensure the browser grants audio permission.

Empty and Error States

SituationWhat the KDS Shows
No active orders✅ “¡Cocina Despejada!” with a refresh button
API unreachable⚠️ “Error de Conexión” with the error message and a Reintentar button
Loading on first openSpinning loader centered on screen

Backend API Reference

Fetch Active Orders

GET /api/v1/ordenes?estatus=activo
Content-Type: application/json
The backend filters for orders with estado_orden IN ('recibido', 'preparando') and returns them sorted by num_ticket descending (newest first).

Advance Order Status

PUT /api/v1/ordenes/{num_ticket}
Content-Type: application/json

{
  "Estatus_Orden": "Preparando",
  "estado_orden": "preparando"
}
Both casing variants are sent simultaneously to ensure compatibility with the backend regardless of which field name it reads first. The backend normalizes to lowercase before comparing against the EstadoOrdenEnum.

Build docs developers (and LLMs) love