Closed yjjw closed 2 years ago
Thank you for this big amount of work! Actually, it is more than expected, but maybe it also makes sense. One thing is that I'm not sure whether the quantity of items can be separated for each shopcart, if you create the model in this way. It looks like that in the code we have an Item table associated differently with each shopcart record, which means the actual records are shared although the mapping is different. If I'm thinking it in a wrong way, please just ignore. But if it is the case, you can contact me, and I will share my thought to fix it. Another thing is that since items are just products that will store in other teams' database, I'm not sure if we should keep their information other than id and quantity.
Thanks to the useful suggestions of Yuwen, after discussion, we decided to refactor the schema. Now we have the model schema changed from two tables(Shopcart and Item) to one table (Shopcart-Item)
Wow that's a lot of work, thank you so much both!
Finish implementing the model schema (including Shopcart and Item). Split test_models.py to two classes: test_items.py and test_shopcarts.py.