This is a documentation of Parking lot API built using NestJS
npm install
npm run start:dev
The API calls to the Parking System app is described below.
GET /status
http://localhost:3000/status
[
{"slot_no":1,"registration_no":"KA-01-HH-1234","color":"red"},
{"slot_no":2,"registration_no":"KA-01-HH-1235","color":"blue"},
{"slot_no":4,"registration_no":"KA-01-HH-1236","color":"black"}
]
POST /parking_lot
http://localhost:3000/parking_lot
{"no_of_slot":9}
{"total_slot": 9}
PATCH /parking_lot
http://localhost:3000/parking_lot
{"increment_slot":3}
{"total_slot":9}
POST /park
http://localhost:3000/park
{
"car_reg_no":"KA-01-AB-2211",
"car_color":"white"
}
{"allocated_slot_number":1}
GET /registration_numbers/:color
http://localhost:3000/registration_numbers/white
[
"KA-01-HH-1234",
"KA-02-AB-9999",
"KA-03-PK-2211"
]
GET /slot_numbers/:color
http://localhost:3000/slot_numbers/white
[
"2",
"7",
"9"
]
DELETE /clear
http://localhost:3000/clear
{"slot_number":"1"}
{"car_registration_no":"KA-01-AB-2211"}
{"freed_slot_number":1}