API application created by using ruby on rails and sqlite3 database to store data and make it helpfull for the manage orders.
Run this command to your terminal:
bundle install
bundle exec rails db:migrate
(optional) only use for dummy data
bulid exec rails db:seed
Run this command to your terminal:
bundle exec rails s
bundle exec whenever --update-crontab
or, if you using replit just click run button.
For testing with rspec run this command:
bundle exec rspec -fd
Root Domain
https://Gigih-Family-Catering-dakunesu.gojek22.repl.co/
next, sample url shortened path and parameters only.
Kategori
- for update data, use parameters for what you want to change
Method | URL Path | Parameter | Description |
---|---|---|---|
GET | /api/kategori |
- | list kategori |
GET | /api/kategori/:id |
- | detail kategori |
POST | /api/kategori |
|
buat kategori |
PATH | /api/kategori/:id |
|
ubah kategori |
DELETE | /api/kategori/:id |
- | hapus kategori |
Menu
- for update data, use parameters for what you want to change
Method | URL Path | Parameter | Description |
---|---|---|---|
GET | /api/menu |
- | list menu |
GET | /api/menu/:id |
- | detail menu |
POST | /api/menu |
|
buat menu |
PATH | /api/menu/:id |
|
ubah menu |
DELETE | /api/menu/:id |
- | hapus menu |
Order
- for update data, use parameters for what you want to change
Method | URL Path | Parameter | Description |
---|---|---|---|
GET | /api/order |
- | list order |
GET | /api/order/:id |
- | detail order |
POST | /api/order |
buat order | |
POST | /api/order/:id/paid |
- | paid order |
PATH | /api/order/:id |
ubah order | |
DELETE | /api/order/:id |
- | hapus order |
Order Menu
- for update data, use parameters for what you want to change
Method | URL Path | Parameter | Description |
---|---|---|---|
GET | /api/order/:order_id/menu |
- | list order menu |
GET | /api/order/:order_id/menu/:menu_id |
- | detail order menu |
POST | /api/order/:order_id/menu |
|
buat order menu |
PATH | /api/order/:order_id/menu/:menu_id |
|
ubah order menu |
DELETE | /api/order/:order_id/menu/:menu_id |
- | hapus order menu |
Report
- clear the parameters on the date filter for today only.
Method | URL Path | Parameter | Description |
---|---|---|---|
GET | /api/report?filter=date |
|
report by date |
GET | /api/report?filter=harga |
|
report by price |
GET | /api/report?filter=email |
|
report by email |
Unpaid Order
for order status below 5 p.m today, it will automatically be changed to unpaid / canceled.
or, you can use this to change the status semi-automatically.
Method | URL Path | Parameter | Description |
---|---|---|---|
POST | /api/order/unpaid |
- | unpaid all new order under 5 p.m. |