List functional requirements for the system (Ask the chat bot for hints if stuck.)...
| Method | URL | Req body | Response code | Resp body |
| post | /check-in | {carType : "", userId :"" ,parkinglotid:""} | 201 - booked, 404 - no slot | { bookedID :"", parkingNumber : "", costPermin ="", bookedTime ="",carType = "",parkinglotid:""} |
| post | /check-out | {bookedIId = "", userId : "", parkingNumber :"",parkinglotid:""} | 201-checked out, 404 - not booked | { checoutid : "", bookedID :"", parkingNumber : "", costPermin ="", bookedTime ="",carType = ""}, checkoutTime :"", cost :"", durationparked : "",parkinglotid:""} |
| get | /getSlots | 200 -ok , 204 - not content | [{parkinglcn-number, carType},{},{}] | |
| get | /getSlots?from=time&to=time | 200 -ok , 204 - not content | [{parkinglcn-number, carType},{},{}] | |
| post | /Users | {email :"", car-type :""} | 201 created, 2xx already exist | {userid : "", email: "", cartype:"} |
| DELETE | /Users | {userId:""} | 200 success, 404 not fount | |
| PATCH | /users | {email :"", car-type :""} | 201 created, 2xx already exist | {userid : "", email: "", cartype:"} |
| Post | /pay | {checkOutId:"", userid :"", "amount :"",parkinglotid:""} | 200 -ok , 5xx- not content | {status : "", timePaid :"",parkinglotid:""} |
erDiagram PARKING_LOT ||--o{ PARKING : contains PARKING ||--o{ PARKING_USER_MAPPING : reserves USER ||--o{ PARKING_USER_MAPPING : makes PARKING_LOT { string lot_id "Primary Key" string lot_name "Name of the parking lot" date created "Creation timestamp of the parking lot" boolean isOpen "Status indicating if the lot is open for parking" int capacity "Total parking capacity in the lot" } PARKING { string parking_id "Primary Key" string parking_lot_id "Foreign Key referencing PARKING_LOT" boolean isWorking "Status indicating if the parking spot is operational" string car_type_parkable "The type of car that can use this parking spot" } USER { string user_id "Primary Key" string email "Email address of the user" string car_type "Type of car owned by the user" } PARKING_USER_MAPPING { string id "Primary Key" string user_id "Foreign Key referencing USER" string parking_id "Foreign Key referencing PARKING" timestamp time "The time when the spot is reserved" boolean isReserved "Status indicating if the spot is reserved" }
Explain how the request flows from end to end in your high level design. Also you could draw a sequence diagram using the diagramming tool to enhance your explanation...
Dig deeper into 2-3 components and explain in detail how they work. For example, how well does each component scale? Any relevant algorithm or data structure you like to use for a component? Also you could draw a diagram using the diagramming tool to enhance your design...
Explain any trade offs you have made and why you made certain tech choices...
Try to discuss as many failure scenarios/bottlenecks as possible.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?