0felicia0 / Shoetopia

0 stars 0 forks source link

Code Review Comments (Nick Patrick) #17

Open nckptrck opened 11 months ago

nckptrck commented 11 months ago
  1. For create_account, you may want to check if a user is already in the database so there are no duplicate rows with the exact same information
  2. Similarly, you may not want people to have the same shop name as another shop that already exists. I recommend checking that the shop name is unique in the create shop endpoint.
  3. For your set_item_quantity function, I recommend adding the cart id, as well as the listing id into the post/curl statement. You can check the schema for the potion lab and basically copy gthe post statement there. "@router.post("/{cart_id}/items/{item_sku}")" replacing item_sku with listing_id
  4. You can also do something similar in checkout. the curl statement should include the cart_id
  5. Also, I recommend looking over shop.py and checking each of the curls. You could add "shop_id" or "account_id" where need be.
  6. For checkout, you may want to return something other than True/false. for example, a message saying "Cart successfully checked out"/ "Checkout failed"
  7. As of now, your post_application function just counts the sum of the quantity, meaning the total amount of shoes they have in their inventory at the moment. Instead, you should do something like count* where quantity <0 from the ledger. This would at least count how many times customers have purchased shoes from them, rather than their current stock of shoes.
  8. I would recommend combining the post_application function and the uodate_verification. i do not see the purpose of having them in two separate functions.
  9. Pretty minor issue but you should change the server.py code to include members of your group as the contact
  10. In filter, max and min price should be floats, not ingtegers.
  11. Also, size should be a float so that people can search for half shoe sizes. 12.You should also have a condition "if min_price != 1" so that you can filter by the minimum price
jackalnom commented 10 months ago

You never want to use floats for money. Most commonly, people just store money in terms of cents and use integers.