# Tables
Tables are used to represent the physical table the restaurant has in a branch to be shown in Ristecho cashier app for assigning orders and managing reservations.
# The Table Object
# Sample
{
"section": {
"id": "8f89a6f0"
},
"id": "8f89a6f2",
"name": "Table 1",
"status": 1,
"seats": 4,
"created_at": "2020-01-05 08:42:21",
"updated_at": "2020-01-05 08:42:37",
"deleted_at": null
}
# Attributes
| Field | Type | Rule | Description |
|---|---|---|---|
id | string | Unique identifier for the table. | |
name | string | updatable | Name of the table. |
section | object | updatable includable | The Section object attached to the table. |
status | integer | The Table Status. | |
seats | integer | updatable | The Number of seats of the table. |
accepts_reservations* | Boolean | updatable | If true, table can be available for reservation, if false, the table will not be available for reservation. |
created_at | string | sortable | Time YYYY-MM-DD HH-MM-SS in UTC at which the object was created. |
updated_at | string | sortable | Time YYYY-MM-DD HH-MM-SS in UTC at which the object was updated. |
deleted_at | string | nullable | Time YYYY-MM-DD HH-MM-SS in UTC at which the object was deleted. |
# Table Statuses
| Type | Description |
|---|---|
1 | Free. |
2 | Occupied. |
3 | Check Printed. |
4 | Reserved. |
# List Tables
GET /tables
# Scope
general.read
# Filters
idnamecreated_ondeleted_onupdated_onstatussection_idupdated_afteris_deleted
# Response
{
"data": [
{
"section": {
"id": "8f89a6f0"
},
"id": "8f89a6f2",
"name": "Table 1",
"status": 1,
"seats": 4,
"created_at": "2020-01-05 08:42:21",
"updated_at": "2020-01-05 08:42:37",
"deleted_at": null
}
]
}
# Get Table
GET /tables/{tableId}
# Scope
general.read
# Response
{
"data": {
"section": {
"id": "8f89a6f0"
},
"id": "8f89a6f2",
"name": "Table 1",
"status": 1,
"seats": 4,
"created_at": "2020-01-05 08:42:21",
"updated_at": "2020-01-05 08:42:37",
"deleted_at": null
}
}
# Create Table
POST /tables
# Scope
tables.write
# Request
{
"name": "Adams PLC",
"seats": 5,
"section_id": "8cd1956b"
}
# Response
{
"data": {
"section": {
"id": "8f89a6f0"
},
"id": "8f89a6f2",
"name": "Table 1",
"status": 1,
"seats": 4,
"created_at": "2020-01-05 08:42:21",
"updated_at": "2020-01-05 08:42:37",
"deleted_at": null
}
}
# Update Table
PUT /tables/{tableId}
# Scope
tables.write
# Request
{
"name": "Adams PLC",
"seats": 5,
"status": 1,
"section_id": "8cd1956b"
}
# Response
{
"data": {
"section": {
"id": "8f89a6f0"
},
"id": "8f89a6f2",
"name": "Table 1",
"status": 1,
"seats": 4,
"created_at": "2020-01-05 08:42:21",
"updated_at": "2020-01-05 08:42:37",
"deleted_at": null
}
}
# Delete Table
DELETE /tables/{tableId}
# Scope
tables.write
# Restore Table
PUT /tables/{tableId}/restore
# Scope
admin.restore