Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/luisumit/LaPreviaRestobar/llms.txt

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

The tables resource models the physical dining area of La Previa Restobar. Each table record holds its current occupancy status, an optional reference to the active order, and a seating capacity. The Android app reads the table list to populate the floor plan view, then updates table status automatically as orders move through their lifecycle — a table becomes OCUPADA when an order is created against it and returns to LIBRE once the order is COMPLETED.

Table Status Values

StatusMeaning
LIBRETable is empty and available for new guests
OCUPADATable has an active order in progress
RESERVADATable is reserved but guests have not yet arrived

TableDto — API Response Fields

The fields below are returned by the API in TableDto. They map directly to TableDto.kt.
id
integer
required
Numeric table identifier. Used in path parameters when updating status.
number
integer
required
Human-readable table number displayed on the floor plan and order tickets.
status
string
required
Current occupancy status. One of LIBRE, OCUPADA, RESERVADA.
currentOrderId
string | null
ID of the active order associated with this table. null when the table is LIBRE.
Local model note: The capacity, version, and syncStatus fields exist on the local Table model (used by Room and the Android ViewModel) but are not part of TableDto and are therefore not returned by the API. They are populated with defaults (capacity = 4, version = 0, syncStatus = "SYNCED") when TableDto.toTable() maps the DTO to the local model.

Local Table model — additional fields (not in API response)

capacity
integer
Maximum number of guests the table can seat. Defaults to 4.
version
number
Optimistic concurrency counter. Incremented on every write to help detect concurrent updates.
syncStatus
string
Local sync state on the Android client. Defaults to "SYNCED".

GET /tables

Returns every table record stored in the tables node of Firebase.
curl -X GET http://localhost:3000/tables \
  -H "Accept: application/json"
Response 200 OK
[
  {
    "id": 1,
    "number": 1,
    "status": "LIBRE",
    "currentOrderId": null
  },
  {
    "id": 2,
    "number": 2,
    "status": "OCUPADA",
    "currentOrderId": "order_11a2b3"
  },
  {
    "id": 3,
    "number": 3,
    "status": "RESERVADA",
    "currentOrderId": null
  }
]

GET /tables/{id}

Returns a single table record by its numeric ID. Path parameters
id
integer
required
The numeric table ID.
curl -X GET http://localhost:3000/tables/2 \
  -H "Accept: application/json"
Response 200 OK
{
  "id": 2,
  "number": 2,
  "status": "OCUPADA",
  "currentOrderId": "order_11a2b3"
}

PUT /tables/{id}/status

Updates the occupancy status of a table. Called automatically by the Android app when an order is created (→ OCUPADA) or completed (→ LIBRE), and can also be triggered manually by staff to mark a table as RESERVADA. Path parameters
id
integer
required
The numeric table ID to update.
Request body (StatusUpdateRequest)
status
string
required
The new status value. Must be one of: LIBRE, OCUPADA, RESERVADA.
curl -X PUT http://localhost:3000/tables/2/status \
  -H "Content-Type: application/json" \
  -d '{"status": "LIBRE"}'
Response 200 OK — returns the updated TableDto.
{
  "id": 2,
  "number": 2,
  "status": "LIBRE",
  "currentOrderId": null
}
Setting a reservation
curl -X PUT http://localhost:3000/tables/3/status \
  -H "Content-Type: application/json" \
  -d '{"status": "RESERVADA"}'
Response
{
  "id": 3,
  "number": 3,
  "status": "RESERVADA",
  "currentOrderId": null
}

Build docs developers (and LLMs) love