As a user
I want to be able to perform a RESTful API call to discontinue a product.
Assumptions:
This would be a PUT and would look like the following:
PUT /products/123/discontinue
Calling this action will set a boolean 'discontinued' flag on a product.
Acceptance Criteria:
If the Product ID is valid, then the product will be updated so that its 'discontinued' flag will be set to true. The server will response with a HTTP 200 message with a JSON representation of the object. If the Prouct ID is not valid (i.e. the product does not exist), the server will respond with an HTTP 404 message.
In a more advanced iteration of the API, the discontinue action would also update inventory and recommendation systems, though this is beyond the scope of this issue.
The introduction of a 'discontinued' flag has other implications to our API. The 'discontinued' attribute should be made available in searching/filtering for products. Currently we don't have a hard-coded schema, so by default, if a product (JSON) object does not have a 'discontinued' attribute then it is considered available, i.e. not discontinued.
As a user I want to be able to perform a RESTful API call to discontinue a product.
Assumptions: This would be a PUT and would look like the following:
PUT /products/123/discontinue
Calling this action will set a boolean 'discontinued' flag on a product.Acceptance Criteria: If the Product ID is valid, then the product will be updated so that its 'discontinued' flag will be set to true. The server will response with a HTTP 200 message with a JSON representation of the object. If the Prouct ID is not valid (i.e. the product does not exist), the server will respond with an HTTP 404 message.
In a more advanced iteration of the API, the discontinue action would also update inventory and recommendation systems, though this is beyond the scope of this issue.
The introduction of a 'discontinued' flag has other implications to our API. The 'discontinued' attribute should be made available in searching/filtering for products. Currently we don't have a hard-coded schema, so by default, if a product (JSON) object does not have a 'discontinued' attribute then it is considered available, i.e. not discontinued.