Task 1 Node.js: Orders API

1. Download the project

The project contains a partially implemented Express API. Your task is to complete the missing endpoints in src/routes/orders.js.

Download orders-api.zip
2. Run locally
unzip orders-api.zip
cd orders-api
npm install
npm start     # http://localhost:3000
npm test      # goal: 5/5 passing

3. What to implement

Open src/routes/orders.js — all TODO comments are there. Do not change any other files.

POST /orders
Create order → return 201
PUT /orders/:id
Update status → 200 or 400
GET /orders?status=
Fix broken filter → 200 or 400
When done: send src/routes/orders.js + screenshot of npm test showing 5/5 tests passing to hiring@swiftbuildplatform.art

Task 2 JavaScript: Order Filter Component

Add your filter input below. Implement the filtering logic in the <script> block at the bottom of this page. The input must have data-testid="order-filter".
#CustomerProductQty Unit PriceTotalStatusDate
1001John SmithMacBook Pro 14"1$1,999$1,999Completed2024-01-15
1002Anna JohnsoniPhone 15 Pro2$999$1,998Pending2024-01-16
1003Mike BrownSony WH-1000XM51$349$349Cancelled2024-01-16
1004Sarah DavisiPad Air 51$749$749Completed2024-01-17
1005Tom WilsonDell XPS 151$1,299$1,299Pending2024-01-17
1006Lisa ChenSamsung Galaxy S243$899$2,697Completed2024-01-18
1007James LeeApple Watch S92$399$798Cancelled2024-01-18
1008Emma WhiteBose QuietComfort 451$279$279Pending2024-01-19