Skip to content

ilhammprs/Test-Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TESTING CODE

Library yang digunakan

INSTALASI

ubah configurasi database pada file config/config.json

Install Package, Migrasi database

npm install
npx sequelize-cli db:migrate
npx sequelize-cli db:undo # untuk migrate ulang
npm start

Routes

localhost:5000/api/v1/register # Register(s) (POST)
localhost:5000/api/v1/login # Login user (POST)
localhost:5000/api/v1/jadwal # Menambahkan Jadwal (POST)
localhost:5000/api/v1/jadwal/:id # get jadwal by id (GET)
localhost:5000/api/v1/jadwal/:id # update quota by id (PATCH)
localhost:5000/api/v1/pesan # pemesanan oleh customer (POST)

Example Requests

Register
{
  "name": "admin",
  "email": "admin@gmail.com",
  "password": "123456",
  "address": "jakarta barat"
}
Login
{
  "email": "admin@gmail.com",
  "password": "123456"
}
Menambahkan Jadwal
{
   "jadwal": "7/12/2022",
    "quota": "53"
}
Update quota by id
{
     "quota": "70"
}
Pemesanan Oleh Customer
{
    "idJadwal": "1",
    "name": "mas awi",
    "phone": "082122034",
    "tipe_mobil": "alya",
    "no_plat": "B 7653 CB",
    "kerusakan": "ban pecah",
    "waktu_pesan": "10.19"
}
screenshot

photo1671474285

Dan ketika customer memesan maka quota yang berada di tabel jadwal akan berkurang 1, bisa dilihat di gambar diatas ini

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors