ksquareincmx / poc-chef-server

Wanna order tortas? We gotcha covered fam!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mark many orders as cancelled

SalasSamuel opened this issue · comments

As a user, I want to be able to mark many orders as cancelled.

Constraints

  • User must be logged in

Scenario 1
Admin tries to mark many orders as cancelled.
System Response: notifies the user that the orders were marked as cancelled

Request:

POST /api/v1/orders/actions
accept: application/json


{
  "action": "mark_as_cancelled",
  "ids": ["1", "2"]
}

Response:

HTTP 1.1 200 Ok

Scenario 2
User tries to mark many orders as cancelled, but the user is not logged in
System Response: notifies the user that is not logged in

Request:

POST /api/v1/orders/actions
accept: application/json


{
  "action": "mark_as_cancelled",
  "ids": ["1", "2"]
}

Response:

HTTP 1.1 401 Unauthorized

{
  "code": "401",
  "message": "Unauthorized"
}

Scenario 3
User tries to mark many orders as cancelled, but the service is not available
System Response: notifies the user that the service is not available

Request:

POST /api/v1/orders/actions
accept: application/json


{
  "action": "mark_as_cancelled",
  "ids": ["1", "2"]
}

Response:

HTTP 1.1 500 Internal Server Error

{
  "code": "500",
  "message": "Internal Server Error"
}