- Clone the project
- Run
docker compose up -d
- Import the postman collection in
postman
folder to test the APIs
This project is a test project for ApzonIRS company. It is a simple project that contains 4 APIs: Here is the conversion of the table to a list:
-
Get all Orders
- Method: GET
- Path: /api/orders
- Body: None
- Response:
[ { "id": "07e3c75a-2d92-4ae3-9b78-08dc591d7791", "orderStatus": "Delivered", "name": "Gorgeous Cotton Mouse", "createdAt": "2024-04-10T05:17:07.4231193", "updatedAt": "2024-04-10T05:55:55.9490797" }, { "id": "1009cfe9-6156-4726-9b79-08dc591d7791", "orderStatus": "Delivered", "name": "Licensed Metal Salad", "createdAt": "2024-04-10T05:17:07.4323561", "updatedAt": "2024-04-10T06:08:29.5611939" } ]
-
Get Order by Id
- Method: GET
- Path: /api/orders/:id
- Body: None
- Response:
{ "id": "d70623b5-b52a-4ed3-3357-08dc59275191", "orderStatus": "Pending", "name": "Order 2024-04-10T06:28:50.223Z", "createdAt": "2024-04-10T06:28:50.2389783", "updatedAt": "2024-04-10T06:28:50.2389785" }
-
Create Order
- Method: POST
- Path: /api/orders
- Body:
{ "name": "string" }
- Response: 201
{ "id": "e790aac1-8716-42d4-1f64-08dc59253d06", "orderStatus": "Pending", "name": "Order 2024-04-10T06:14:45.005Z", "createdAt": "2024-04-10T06:14:45.0175178Z", "updatedAt": "2024-04-10T06:14:45.0175179Z" }
-
Create Delivery
- Method: POST
- Path: /api/deliveries
- Body:
{ "orderIds" : ["07e3c75a-2d92-4ae3-9b78-08dc591d7791"] }
- Response:
- 201:
{ "id": "7bf8ab29-27f4-4743-a06f-5324f765775d", "orderIds": [ "07e3c75a-2d92-4ae3-9b78-08dc591d7791" ] }
- 400:
Order #07e3c75a-2d92-4ae3-9b78-08dc591d7791 already delivered
- 404:
Order #07e3c75a-2d92-4ae3-9b78-08dc591d7791 not found
- 201: