Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Parking App API:
- Assume that we are building a parking app for SF city and we need two API's.
- Build the following REST APIs. (choose Django or Flask framework. DB is of your choice.)
- 1. REST API to list all **available** parking spots.
- - Input params: {lat, lng, radius}
- response: returns an array of elements each containing an id, lat and lng.
- 2. REST API to reserve an available parking spot. input params: { parking_spot, time-range }
- Note: You can store a dummy lat, lng locations in your table.
- Optional:
- - test cases for the API's
- - view existing reservations
- - cancel existing reservations
- - extend existing reservations.
- Deliverables:
- * Please host the code in a git repo and share the link with me.
- * Commit every logical step.
- Table: parking_spot(have one to one relation with location, customer, parking_reservation tables)
- fields: parking_slot_id, location_id, is_occupied, reserved_for(time in integers),
- Table: customer(have one to one relation with location, parking_reservation tables)
- fields: name, customer_id, email_id,
- Table: location(have one to one relation with parking_spot tables)
- fields: location_id, latitude, longitude
- Table: reservation(have one to one relation with customer table)
- fields: customer_id, parking_slot_id, is_valid
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement