A simple delivery system
To initialize and run the application first run command below:
make up
alternatively you can use:
docker-compose up -d
Then run the migrations with command below:
make migrate
Then you can seed dummy data with command below:
make seed
Finally, You can access the webservice in port 8001
To report a delay on an order
POST /api/v1/delay/{orderId}
Parameter | Type | Description |
---|---|---|
orderId |
int |
Required. (example:1) |
success response:
{
"Status": 200,
"Message": "Sorry for the delay, Our agents will review your report as soon as possible!",
"Data": null
}
To assign a delay report to an agent
POST /api/v1/assign
Header | Type | Description |
---|---|---|
agent-id |
int |
Required. (example:1) |
Note that for simplicity we ignored the authentication and simulated that with a
agent-id
in header
success response:
{
"Status": 200,
"Message": "Delivery report 12 assigned to you",
"Data": null
}
To get a list of vendors with their reports in past week
POST /api/v1/vendor/report
Parameter | Type | Description |
---|---|---|
success response:
{
"Status": 200,
"Message": "",
"Data": [
{
"ID": 1,
"Name": "First Vendor",
"DelayCount": 9
},
{
"ID": 3,
"Name": "Third Vendor",
"DelayCount": 3
}
]
}