role-management
user-management
bill-management
create-bill
update-preparing-bill-status
update-paid-bill-status
update-prepare-done-bill-status
update-delivering-bill-status
update-shipping-bill-status
update-Complete-bill-status
dish-management
daily-dish-management
created
paid
preparing
prepare-done
delivering
shipping
complete
none
morning
noon
afternoon
evening
in-stock
out-of-stock
free
full
POST /api/users/register
body: username, password, email, fullName?, birthday?
POST /api/users/login
body: usernameOrEmail, password
GET /api/users/uuid/:uuid
GET /api/users/:username
GET /api/users/email/:email
GET /api/users/users?offset=1&length=2
query: length?, offset?
PUT /api/users/:username
Need token with permission: user-management
or login with user have username equal to query param username
body: email?, fullName?, birthday?, avatar?
PUT /api/users/:username/password
Need token with permission: user-management
and don't need old password.
If token don't have that permission: User of token have to be user in param and old password is required.
body: newPassword, oldPassword?
POST /api/users/:usename/permissions/:permission
POST /api/users/hierenlee/permissions/update-bill-status
DELETE /api/users/:username/permissions/:permission
DELETE /api/users/hierenlee/permissions/update-bill-status
PUT /api/users/:username/role/:role-slug
PUT /api/dailyDishes?day=2019-05-04&session=none&dishId=2
body: status?, price?
GET /api/dailyDishes?length=2&offset=3
query: length?, offset?
DELETE /api/dailyDishes?day=2019-05-04&dishId=2&session=none
POST /api/dailyDishes
body: day?, dishId, session? status?, price?
GET /api/dailyDishes/getBy?day=2019-05-04&dishId=2&session=none
query: day?, dishId?, session?, length?, offset?
POST /api/roles
body: name, slug?, description?, permission?
PUT /api/roles/:role-slug
body: slug?, name?, description?
GET /api/roles
GET /api/roles/:role-slug
DELETE /api/roles/:role-slug
POST /api/roles/:role-slug/permissions/:permission
POST /api/roles/staff/permissions/user-management
DELETE /api/roles/:role-slug/permissions/:permission
DELETE /api/roles/staff/permissions/user-management
POST /api/dishes
body: name, description?, images?, defaultPrice?
DELETE /api/dishes/:dishId
GET /api/dishes/:dishId
PUT /api/dishes/:dishId
body: name?, description?, images?, defaultPrice?
GET /api/dishes
GET /api/bills
query: length?, offset?
GET /api/bills/user/:username
query: length?, offset?
POST /api/bills
Need Token
body: dishIds, prices, quantities? (quantities.length, prices.length have to equal dishIds.length)
POST /api/bills/custom
body: dishIds, day?, status?
PUT /api/bills/:billId
**body: **day?, status?
Just apply for bill-management
PUT /api/bills/:billId/created
Need corresponding permission:
PUT /api/bills/:billId/paid
PUT /api/bills/:billId/preparing
PUT /api/bills/:billId/prepare-done
PUT /api/bills/:billId/shipping
PUT /api/bills/:billId/complete
GET /api/bills/:billId
query: length?, offset?
DELETE /api/bills/:billId
POST /api/bills/4/dishes/2
POST /api/bills/:billId/dishes/:dishId
DELETE /api/bills/4/dishes/2
DELETE /api/bills/:billId/dishes/:dishId