As a system administrator
I need to have a nested API shopcarts model
So that we conform to RESTful practices and can use our API intuitively
Details and Assumptions
To achieve above, according to the professor: 'There is no need for the -1 dummy item. An empty shopcart has no items and therefore no records in the database. Since there is no "shopcart" in the database, POST /shopcarts should just check that the customer_id is valid and return 201 CREATED. It can optionally accept a list of items and add them to the shoping cart. There is no other need to call this endpoint since the shopcart itself has no records but it is useful to put multiple items in the shopcart at once (i.e., convert a wishlist into a shopcart).'
A valid customer_id is one that 1. has no items in the shopping cart yet 2. is a positive integer
Acceptance Criteria
Given our service is running
When we call POST on /shopcarts with a valid customer_id
Then service returns 201 CREATED
When we call POST on /shopcarts with an invalid customer_id
Then service returns 400 BAD REQUEST
As a system administrator I need to have a nested API shopcarts model So that we conform to RESTful practices and can use our API intuitively
Details and Assumptions
To achieve above, according to the professor: 'There is no need for the -1 dummy item. An empty shopcart has no items and therefore no records in the database. Since there is no "shopcart" in the database, POST /shopcarts should just check that the customer_id is valid and return 201 CREATED. It can optionally accept a list of items and add them to the shoping cart. There is no other need to call this endpoint since the shopcart itself has no records but it is useful to put multiple items in the shopcart at once (i.e., convert a wishlist into a shopcart).'
Acceptance Criteria