Skip to content
All challenges
BackendMedium

Orders API returns the wrong page

An Express orders service skips the first page, crashes on order lookups and answers bad input with 500.

Challenge description

Orders API challenge

Ticket

SHOP-417: Order history and checkout errors in the mobile app

Reported by the mobile team after the last release:

  • The order history never shows the newest customers' first orders. Page 1 seems to start somewhere in the middle, and filtering by Shipped shows an empty list even though the counter says there are 5.
  • Tapping any order shows "Something went wrong", even for orders that exist. For deleted orders we expect "Order not found".
  • When checkout sends an incomplete order, the app gets a 500 and can't show which field is wrong. QA also managed to place an order line with quantity 0.

The API contract is described in README.md, and the tests in tests/ describe the expected behaviour. Fix the service so that all of them pass.

Orders API returns the wrong page · Jobra