Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/MultiSas/llms.txt

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

Tables represent the physical seating units on your restaurant floor. Each table record tracks its number, seating capacity, and two independent availability states — whether it is currently occupied and whether it has a future reservation. Six endpoints let you create, update core details, flip the occupied flag, update a reservation, delete, and list all tables for a company.
All table endpoints require two authentication middlewares. TokenAny validates the bearer token and attaches the user to the request. TokenAuthorize('Admin', 'Super Admin') restricts access to users whose role is either Admin or Super Admin. Include the token in every request as token-access: Bearer $TOKEN.

Create a Table


POST /api/table/:company_id Creates a new table record for the given company.

Path Parameters

company_id
string
required
The MongoDB ObjectId of the owning company.

Body Parameters

number_table
number
required
Identifying number for the table (e.g. 5).
capacity_table
number
required
Maximum number of guests the table can seat.

Response Fields

msj
string
Human-readable result message.
status
boolean
true on success, false on failure.
save_table
object
The newly created table document.

Example

curl -X POST https://api.example.com/api/table/64a1f2c3e4b0a1b2c3d4e5f6 \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN" \
  -d '{
    "number_table": 5,
    "capacity_table": 4
  }'
{
  "msj": "Mesa creada exitosamente",
  "status": true,
  "save_table": {
    "_id": "64d4e5f6a7b8c9d0e1f2a3b4",
    "number_table": 5,
    "capacity_table": 4,
    "occupied": false,
    "reserved": false,
    "hour_reserved": "",
    "observation_reserved": "",
    "company": {
      "_id": "64a1f2c3e4b0a1b2c3d4e5f6",
      "name_company": "Restaurante El Sabor",
      "name_founder": "Juan Pérez",
      "nit_company": "900123456-7",
      "type_dato": "restaurante"
    },
    "createdAt": "2024-01-15T12:00:00.000Z",
    "updatedAt": "2024-01-15T12:00:00.000Z"
  }
}

Update a Table


PUT /api/table/updating/:company_id/:table_id Updates the number_table and capacity_table of an existing table.

Path Parameters

company_id
string
required
The MongoDB ObjectId of the owning company.
table_id
string
required
The MongoDB ObjectId of the table to update.

Body Parameters

number_table
number
required
Updated table number.
capacity_table
number
required
Updated seating capacity.

Response Fields

msj
string
Human-readable result message.
status
boolean
true on success.

Example

curl -X PUT https://api.example.com/api/table/updating/64a1f2c3e4b0a1b2c3d4e5f6/64d4e5f6a7b8c9d0e1f2a3b4 \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN" \
  -d '{
    "number_table": 5,
    "capacity_table": 6
  }'
{
  "msj": "Mesa actualizada exitosamente",
  "status": true
}

Update Table Occupied State


PUT /api/table/updating-occupied/:company_id/:table_id Flips the occupied boolean flag on a table — use this when guests are seated or when a table becomes free.

Path Parameters

company_id
string
required
The MongoDB ObjectId of the owning company.
table_id
string
required
The MongoDB ObjectId of the table to update.

Body Parameters

occupied
boolean
required
true to mark the table as occupied, false to mark it as free.

Response Fields

msj
string
Human-readable result message.
status
boolean
true on success.

Example

curl -X PUT https://api.example.com/api/table/updating-occupied/64a1f2c3e4b0a1b2c3d4e5f6/64d4e5f6a7b8c9d0e1f2a3b4 \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN" \
  -d '{
    "occupied": true
  }'
{
  "msj": "Estado de la mesa actualizado exitosamenete",
  "status": true
}

Update Table Reservation


PUT /api/table/updating-reserved/:company_id/:table_id Sets or clears the reservation state on a table. When a reservation is set, hour_reserved is automatically populated with the current date.

Path Parameters

company_id
string
required
The MongoDB ObjectId of the owning company.
table_id
string
required
The MongoDB ObjectId of the table to update.

Body Parameters

reserved
boolean
required
true to create a reservation, false to clear it.
observation_reserved
string
Optional notes about the reservation (e.g. guest name, special requirements).

Response Fields

msj
string
Human-readable result message.
status
boolean
true on success.

Example

curl -X PUT https://api.example.com/api/table/updating-reserved/64a1f2c3e4b0a1b2c3d4e5f6/64d4e5f6a7b8c9d0e1f2a3b4 \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN" \
  -d '{
    "reserved": true,
    "observation_reserved": "Cumpleaños, decoración especial"
  }'
{
  "msj": "Reserva de la mesa actualizada correctamente",
  "status": true
}

Delete a Table


DELETE /api/table/remove/:company_id/:table_id Permanently removes a table record. This action is irreversible.

Path Parameters

company_id
string
required
The MongoDB ObjectId of the owning company.
table_id
string
required
The MongoDB ObjectId of the table to delete.

Response Fields

msj
string
Human-readable result message.
status
boolean
true on success, false if not found.

Example

curl -X DELETE https://api.example.com/api/table/remove/64a1f2c3e4b0a1b2c3d4e5f6/64d4e5f6a7b8c9d0e1f2a3b4 \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN"
{
  "msj": "Mesa eliminada exitosamente",
  "status": true
}

List Tables


GET /api/table/list/:company_id Returns a paginated list of all tables belonging to the specified company, sorted by most recently created.

Path Parameters

company_id
string
required
The MongoDB ObjectId of the company whose tables to retrieve.

Response Fields

msj
string
Human-readable result message.
status
boolean
true on success.
data
array
Array of table documents for the company.
pagination
object
Pagination metadata.

Example

curl -X GET https://api.example.com/api/table/list/64a1f2c3e4b0a1b2c3d4e5f6 \
  -H "Content-Type: application/json" \
  -H "token-access: Bearer $TOKEN"
{
  "msj": "Cargando mesas",
  "status": true,
  "data": [
    {
      "_id": "64d4e5f6a7b8c9d0e1f2a3b4",
      "number_table": 5,
      "capacity_table": 4,
      "occupied": false,
      "reserved": false,
      "hour_reserved": "",
      "observation_reserved": "",
      "company": {
        "_id": "64a1f2c3e4b0a1b2c3d4e5f6",
        "name_company": "Restaurante El Sabor",
        "name_founder": "Juan Pérez",
        "nit_company": "900123456-7",
        "type_dato": "restaurante"
      },
      "createdAt": "2024-01-15T12:00:00.000Z",
      "updatedAt": "2024-01-15T12:00:00.000Z"
    }
  ],
  "pagination": {
    "pag": "1",
    "perpage": 10,
    "pags": 1
  }
}

Build docs developers (and LLMs) love