Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. Parking App API:
  2.  
  3. Assume that we are building a parking app for SF city and we need two API's.
  4.  
  5. Build the following REST APIs. (choose Django or Flask framework. DB is of your choice.)
  6.  
  7. 1. REST API to list all **available** parking spots.
  8. - Input params: {lat, lng, radius}
  9. response: returns an array of elements each containing an id, lat and lng.
  10.  
  11. 2. REST API to reserve an available parking spot. input params: { parking_spot, time-range }
  12.  
  13. Note: You can store a dummy lat, lng locations in your table.
  14.  
  15. Optional:
  16. - test cases for the API's
  17. - view existing reservations
  18. - cancel existing reservations
  19. - extend existing reservations.
  20.  
  21. Deliverables:
  22.  
  23. * Please host the code in a git repo and share the link with me.
  24. * Commit every logical step.
  25.  
  26. Table: parking_spot(have one to one relation with location, customer, parking_reservation tables)
  27. fields: parking_slot_id, location_id, is_occupied, reserved_for(time in integers),
  28.  
  29. Table: customer(have one to one relation with location, parking_reservation tables)
  30. fields: name, customer_id, email_id,
  31.  
  32. Table: location(have one to one relation with parking_spot tables)
  33. fields: location_id, latitude, longitude
  34.  
  35. Table: reservation(have one to one relation with customer table)
  36. fields: customer_id, parking_slot_id, is_valid
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement