Closed TimothyXu closed 2 years ago
create_shopcarts has 3 possible uses (explained in README.md). I think only the first possible use is relevant for this GUI; the second use is the same as calling post on /shopcarts/
I think the second use can also be implemented if we want. For the third use, I think it's fine to just leave it now. If there is need to have it in the GUI, we can add this feature later. Actually, I think I can implement the third in the way that the text field can accept multiple values seperated by ',' or something.
Makes sense about the third use yes we can do that with commas. But about the second feature, I mean not only is it a redundant feature, I mean that if we implemented it, from the customers perspective it’ll behave in EXACTLY the same way as create_items (the user fills in all 5 text fields, then click add to shop cart). This surely will be exactly the same as how the user would use the second usage case of create_shopcarts? Doesn’t make sense to add another button if the feature is already done using button Add To Shop Cart
@TimothyXu I think the only difference is that when the shopcart already has items, create shopcart with item will return error, and add to shopcart will simply add the item.
@TimothyXu I think the only difference is that when the shopcart already has items, create shopcart with item will return error, and add to shopcart will simply add the item.
Oh you're so right. Yes my bad there is a difference. That makes sense so we need a new button yes.
As a System Administrator I need to have a GUI to create a new shopcart given a user_id So that I can easily start a new cart for a user without using CLI
Details and Assumptions
Add button "Create Shopcart", connect to create_shopcarts.
Acceptance Criteria
Given a set of items | user_id | item_id | item_name | quantity | price | | 1001 | 1 | ring1 | 2 | 1998 | | 1001 | 2 | ring2 | 1 | 1.5 | | 1002 | 1 | ring1 | 3 | 3 | When we visit the "home page" And we enter "1003" to the text box "User_ID" And we press the button "Create-Shopcart" Then we should see message "Successfully Added an empty Shopcart" When we enter "1003" to the text box "User_ID" And we press the button "Retrieve" Then we should not see "ring1" in the results And we should not see "ring2" in the results