GET_ALL_EMPLOYEES
Header
[
{
"id": 1,
"name": "Joseph Climber",
"login": "joseph",
"is_admin": false,
"cpf": "047222222222"
},
{
"id": 2,
"name": "Irineu Rodrigues",
"login": "irineu",
"is_admin": true,
"cpf": "047333333333"
}
]
GET_EMPLOYEE
/api/employees/<employee_id: int>
Header
{
"id": 1,
"name": "Joseph Climber",
"login": "joseph",
"is_admin": false,
"cpf": "047222222222"
}
CREATE_EMPLOYEE
Header
{
"name": "Joseph Climber",
"login": "joseph",
"password": "123456",
"is_admin": false,
"cpf": "047222222222"
}
{
"id": 1,
"name": "Joseph Climber",
"login": "joseph",
"is_admin": false,
"cpf": "047222222222"
}
LOGIN_EMPLOYEE
Header
{
"login": "joseph",
"password": "123456"
}
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmcmVzaCI6ZmFsc2UsImlhdCI6MTYyNjQ0MjgzMywianRpIjoiMTE5MGM5OGQtYTI1Mi00ZjdlLWE3ZWYtOWNkYjA0OTUzYjI3IiwidHlwZSI6ImFjY2VzcyIsInN1YiI6eyJpZCI6MiwibmFtZSI6ImlsbGlhbiIsImxvZ2luIjoiaWxsaWFuIiwiY3BmIjoiMDAwMDAwMDAwMDAiLCJpc19hZG1pbiI6ZmFsc2V9LCJuYmYiOjE2MjY0NDI4MzMsImV4cCI6MTYyNjQ0NjQzM30.pp94uopkA-HjiwvLTQXbGPQv587yHljHpW-27MBkBAE"
}
UPDATE_EMPLOYEE
/api/employees/<employee_id: int>
Header
{
"name": "Joseph Rodrigues"
}
{
"id": 1,
"name": "Joseph Rodrigues",
"login": "joseph",
"is_admin": false,
"cpf": "047222222222"
}
DELETE_EMPLOYEE
/api/employees/<employee_id: int>
Header
GET_ALL_USERS
Header
[
{
"id": 1,
"name": "Joseph Climber",
"cpf": "047222222222",
"total_spent": 345.22
},
{
"id": 2,
"name": "Irineu Cleber",
"cpf": "047333333333",
"total_spent": 57.48
}
]
GET_USER
Header
{
"id": 1,
"name": "Joseph Climber",
"cpf": "047222222222",
"total_spent": 345.22
}
CREATE_USER
Header
{
"name": "Joseph Climber",
"cpf": "047222222222"
}
{
"id": 1,
"name": "Joseph Climber",
"cpf": "047222222222",
"total_spent": 0
}
GET_USER BY QUERY PARAM
/api/users?cpf=<cpf: str>&name=<name: str>
Header
{
"id": 1,
"name": "Joseph Climber",
"cpf": "047222222222",
"total_spent": 345.22
}
UPDATE_USER
/api/users/<user_id: int>
Header
{
"name": "Joseph Rodrigues",
"total_spent": 522.35
}
{
"id": 1,
"name": "Joseph Rodrigues",
"cpf": "047222222222",
"total_spent": 522.35
}
GET_ALL_TABLES
Header
[
{
"id": 1,
"login": "table01",
"number": 1,
"seats": 6,
"user": {
"id": 1,
"name": "Joseph Climber",
"cpf": "047222222222",
"total_spent": 522.35
},
"total": 127.48,
"empty": false,
"orders_list": "/api/orders/1"
},
{
"id": 2,
"number": 1,
"seats": 6,
"user": {},
"total": 127.48,
"empty": true,
"orders_list": "/api/orders/2"
}
]
GET_TABLE
/api/tables/table_id=<table_id: int>
Header
{
"id": 1,
"login": "table01",
"number": 1,
"seats": 6,
"user": {
"id": 1,
"name": "Joseph Climber",
"cpf": "047222222222",
"total_spent": 522.35
},
"total": 127.48,
"empty": false,
"orders_list": "/api/orders/1"
}
GET_TABLE BY QUERY PARAM
/api/tables?empty=<empty: bool>&number=<number: int>
Header
{
"id": 1,
"login": "table01",
"number": 1,
"seats": 6,
"user": {
"id": 1,
"name": "Joseph Climber",
"cpf": "047222222222",
"total_spent": 522.35
},
"total": 127.48,
"empty": false,
"orders_list": "/api/orders/1"
}
CREATE_TABLE
Header
{
"login": "table01",
"password": "table01",
"number": 1,
"seats": 6
}
{
"id": 1,
"login": "table01",
"number": 1,
"seats": 6,
"empty": true
}
UPDATE_TABLE
/api/tables/<table_id: int>
Header
{
"number": 2,
"seats": 4
}
{
"id": 1,
"login": "table01",
"number": 2,
"seats": 4,
"user": {
"id": 1,
"name": "Joseph Climber",
"cpf": "047222222222",
"total_spent": 522.35
},
"total": 127.48,
"empty": false,
"orders_list": "/api/orders/1"
}
PAY_BILL
/api/tables/paybill/<table_id: int>
Header
{
"Total without discount": 140.0,
"Total with discount": 112.0
}
DELETE_TABLE
/api/tables/<table_id: int>
Header
LOGIN_TABLE
Header
{
"login": "Irineu",
"password": "12345"
}
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmcmVzaCI6ZmFsc2UsImlhdCI6MTYyNjIxNDA3NSwianRpIjoiMWJjMDE5ZTktNzY2OS00MzJmLWJhMDctMzE0MjgxZTg0ODU5IiwidHlwZSI6ImFjY2VzcyIsInN1YiI6eyJpZCI6MiwibmFtZSI6Ikx1Y2FzIEpvc2Vmb3ZpY3oiLCJsb2dpbiI6Imx1Y2FzIn0sIm5iZiI6MTYyNjIxNDA3NSwiZXhwIjoxNjI2MjE0OTc1fQ.Mj5yzf4ENLntgmnTs8Hvlvwqa_FI_T1fh_1uQiKy6fU"
}
GET_ALL_ORDERS
Header
[
{
"id": 1,
"date": ,//decidir formato da data
"table_number": 5,
"cooking": false,
"ready": false,
"delivered": false,
"paid": false,
"products": [
{
"id": 1,
"name": "Risoto Carbonara",
"quantity": 2,
"price": 7.80
},
{
"id": 3,
"name": "Fettuccine com molho Marzano",
"quantity": 1,
"price": 15.00
}
],
"total_products": 30.60
},
{
"id": 2,
"date": ,//decidir formato da data
"table_number": 3,
"cooking": true,
"ready": false,
"delivered": false,
"paid": false,
"products": [
{
"id": 4,
"name": "Raviolli de Ricota",
"quantity": 1,
"price": 10.00
}
],
"total_products": 10.00
}
]
GET_ORDER
/api/orders/<table_id: int>
Header
[
{
"id": 1,
"date": ,//decidir formato da data
"table_number": 5,
"cooking": false,
"ready": false,
"delivered": false,
"products": [
{
"id": 1,
"name": "Risoto Carbonara",
"quantity": 2,
"price": 7.80
},
{
"id": 3,
"name": "Fettuccine com molho Marzano",
"quantity": 1,
"price": 15.00
}
],
"total_products": 30.60
}
]
GETORDERS BY QUERY PARAMS
/api/orders?table_id=<table_id: int>?&ready=<ready: bool>&paid=<paid: bool>
Header
[
{
"id": 1,
"date": ,//decidir formato da data
"table_number": 5,
"cooking": false,
"ready": false,
"delivered": false,
"products": [
{
"id": 1,
"name": "Risoto Carbonara",
"quantity": 2,
"price": 7.80
},
{
"id": 3,
"name": "Fettuccine com molho Marzano",
"quantity": 1,
"price": 15.00
}
],
"total_products": 30.60
}
]
CREATE_ORDER
Header
{
"date": "Timestamp -> Unix", //decidir formato da data
"table_id": 5,
"products": [1, 2, 3, 1]
}
{
"id": 1,
"date": ,//decidir formato da data
"table_number": 5,
"cooking": false,
"ready": false,
"delivered": false,
"products": [
{
"id": 1,
"name": "Risoto Carbonara",
"quantity": 2,
"price": 7.80
},
{
"id": 3,
"name": "Fettuccine com molho Marzano",
"quantity": 1,
"price": 15.00
}
],
"total_products": 30.60
}
UPDATE_ORDER
/api/orders/<order_id: int>
Header
{
"cooking": false,
"ready": true,
"delivered": false
}
[
{
"id": 1,
"date": ,//decidir formato da data
"table_number": 5,
"cooking": false,
"ready": true,
"delivered": false,
"products": [
{
"id": 1,
"name": "Risoto Carbonara",
"quantity": 2,
"price": 7.80
},
{
"id": 3,
"name": "Fettuccine com molho Marzano",
"quantity": 1,
"price": 15.00
}
],
"total_products": 30.60
}
]
DELETE_ORDER
/api/orders/<order_id: int>
Header
GET_ALL_PRODUCTS
Header
[
{
"id": 1,
"name": "Risoto Carbonara",
"section": "Pratos principais",
"price": 7.8,
"calories": 587.87
},
{
"id": 3,
"name": "Fettuccine com molho Marzano",
"section": "Pratos principais",
"price": 15.0,
"calories": 635.22
}
]
GET_PRODUCT
/api/products/<product_id: int>
Header
{
"id": 1,
"name": "Risoto Carbonara",
"section": "Pratos principais",
"price": 7.8,
"calories": 587.87
}
GET_PRODUCTS BY QUERY PARAM
/api/products?section=<section: bool>?veggie=<veggie: bool>
Header
[
{
"id": 1,
"name": "Risoto Carbonara",
"section": "Pratos principais",
"price": 7.8,
"calories": 587.87
},
{
"id": 3,
"name": "Fettuccine com molho Marzano",
"section": "Pratos principais",
"price": 15.0,
"calories": 635.22
}
]
CREATE_PRODUCT
Header
{
"name": "Risoto Carbonara",
"price": 7.8,
"calories": 587.87
}
{
"id": 1,
"name": "Risoto Carbonara",
"section": "None",
"price": 7.8,
"calories": 587.87
}
UPDATE_PRODUCT
/api/products/<product_id: int>
Header
{
"id": 1,
"name": "Risoto Carbonara",
"section": "None",
"price": 18.8,
"calories": 587.87
}
UPDATE_PRODUCT
/api/products/<product_id: int>
Header