Luke-Fanguna / FoodForLesser

0 stars 0 forks source link

Schema/API Design Comments (Dennis Phun) #28

Open dphun123 opened 10 months ago

dphun123 commented 10 months ago
  1. The APISpec should be formatted (rather than just being blocks of text) for ease of reading.
  2. If the user is only allowed to have a max of one grocery list (seems to be one or zero), it is possible to just have a column for user_id in grocery_list_items and completely remove the grocery_list table. Then, their list can be obtained by doing a query on grocery_list_items with "WHERE user_id = …".
  3. Instead of having data being passed in the URL, a better practice would be placing it in the request's body. You can simply remove it from the URL while keeping it in the function parameters.
  4. Instead of having update_posting, consider keeping a ledger (since the only update is in the quantity) or versions if you are going to add more information. If you do so, remember to change set_item_quantity to a PUT request.
  5. By convention, "delete" shouldn't be included in the URL. Instead, have a DELETE request with the URL pointing to what you are deleting.
  6. The URL for creating a crowdsource listing does not make sense.
  7. Consider giving users the option to update the inventory levels for their crowdsource listings.
  8. The endpoints for distribute_list and find_best_item should be GET requests.
  9. I don't understand why the stores are ordered by their id's or why that is shown to the user.
  10. Add error checking with descriptive messages such as the ones described in Exceptions.
  11. Add more constraints to your schema such as values not being able to be null.
  12. The order in which your schema is set up makes certain tables that require foreign keys to other tables that are not created yet.