As a administrator
I need to update an order's status to
So that I can track it effectively
Details and Assumptions
The Order model includes a status field.
The action should follow REST API guidelines and use a route accepting a PUT request.
The route should accept a PUT request to /orders/<int:order_id>/status with a body parameter for status.
The status change should be idempotent; updating an order already marked as "In Progress" has no additional effect.
If the order is in an incompatible status, an error should be returned.
Unit tests must be written to cover this new feature.
Acceptance Criteria
Given an order exists with status "In Progress" / "Shipped" / "Complete" / "Cancel"
When I send a PUT request to /orders/1/status with "status": <given status> Then the order's status is updated to and the updated order is returned
Given an order exists with status "In Progress" When I send a PUT request to /orders/1/status with "status": "In Progress" Then the order's status remains "In Progress" with no additional changes, and the updated order is returned
Given an order exists with status "Cancelled"/ When I send a PUT request to /orders/2/status with "status": <given status> **Then** I receive a400 Bad Request` error indicating that the status cannot be changed
I think the issue “Update Order Status” should cover all Status (after the Enum is defined), not only ‘In progress’, but also something like 'Completed', 'Canceled', etc.
As a administrator I need to update an order's status to So that I can track it effectively
Details and Assumptions
Order
model includes astatus
field.PUT
request.PUT
request to/orders/<int:order_id>/status
with a body parameter forstatus
.Acceptance Criteria
Given an order exists with
status
"In Progress" / "Shipped" / "Complete" / "Cancel" When I send aPUT
request to/orders/1/status
with"status": <given status>
Then the order's status is updated to and the updated order is returned
Given an order exists with
status
"In Progress"When I send a
PUT
request to/orders/1/status
with"status": "In Progress"
Then the order's status remains "In Progress" with no additional changes, and the updated order is returned
Given an order exists with
status
"Cancelled"/When I send a
PUT
request to/orders/2/status
with"status": <given status> **Then** I receive a
400 Bad Request` error indicating that the status cannot be changed