0felicia0 / Shoetopia

0 stars 0 forks source link

Schema/API Design - Jin Wu #14

Open jinwu23 opened 11 months ago

jinwu23 commented 11 months ago

1) cart_items should always point to a specific cart so I think cart_id should never be null, that would mean there is an item in an unknown cart.

2) cart_items should not exist if there is no quantity associated with it, so the quantity should be not null and always be 1 or greater, as a cart_item with quantity zero should just not exist.

3) I would consider more descriptors to put under shoes. With how specialized this product is, the majority of users probably really care about exactly what shoe they are buying. Maybe add date_released, condition, and if it has all original accessories.

4) I think adding a rating column to shops would be good for users to easily see how trustworthy a shop is at a quick glance.

5) I would add a reviews table with foreign key references to shops and the user who left the review as well as a rating(int) and a description(text) so users can leave ratings for particular shops and other users can judge a shop off of more descriptive ratings.

6) Maybe add a way for users to display themselves without using either their email or real name as that can help with privacy.

7) It seems that there is no way to take a listing off of the site after it has been sold other than to delete the listing all together. Maybe add a boolean column to it (active) to only display listings that are not sold, and keep all sold listings in the database.

8) I think shop_balance_ledger (balance) should not be an integer as people can pay with cents as well, so a float would fit it better, same with all other variables representing dollar amounts.

9) I assume that dollar amounts are in USD but it might help to keep track of that in case you need to do conversions with other countries.

10) Maybe add an endpoint in /catalog/ to display all listings without needing any filters to apply.

11) the endpoint /shop/create_shop takes in a store name and store owner both as strings. This may cause problems when there are two users on the platform with the same name. I think that creating a shop based off of a unique identifier (user id) would be much better.

12) the endpoint /carts/{cart_id}/checkout passes in gold_paid, which seems a bit odd for a real life shop.