StPfeffer / rusty-roads

A simple route manager application written in Rust
MIT License
0 stars 0 forks source link

Feature Request: Implement Route Status Scope #86

Closed StPfeffer closed 3 weeks ago

StPfeffer commented 3 weeks ago

Description

Implementation of the route status scope.

Endpoints

Method Endpoint Description
GET /api/v1/routes/status List all the available route status.
GET /api/v1/routes/status/:statusId Returns the status referring to the given ID.
GET /api/v1/routes/:routeId/status Returns the status referring to the given route ID.
POST /api/v1/routes/staus Creates a route status.
DELETE /api/v1/routes/status/:statusId Deletes the route status.

Payloads

List all the available route status

Response
{
    "status": [
        {
            "id": "a8449322-e5c9-47d5-89f8-d767172476a8",
            "code": "CREATED",
            "description": "Created"
        },
        {
            "id": "520aeebc-3a48-4875-8aea-a1bd2ce1369a",
            "code": "IN_PROGRESS",
            "description": "In progress"
        }
    ],
    "results": 2
}

Returns the status referring to the given ID (or route ID)

Response
{
  "id": "a8449322-e5c9-47d5-89f8-d767172476a8",
  "code": "CREATED",
  "description": "Created"
}

Creates a route status

Request
{
    "code": "IN_PROGRESS",
    "description": "In progress"
}
Response
{
  "id": "a8449322-e5c9-47d5-86f8-d5867972236a8",
  "code": "IN_PROGRESS",
  "description": "In progress"
}

Delete a route

Response
{
  "id": "a8449322-e5c9-47d5-89f8-d767172476a8",
  "code": "CREATED",
  "description": "Created"
}

Type of change

Checklist