StPfeffer / rusty-roads

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

Feature Request: Additional API Routes #95

Closed StPfeffer closed 3 weeks ago

StPfeffer commented 3 weeks ago

Description

Added new routes to get and delete the vehicle documents. Added a new route to update a country by it's ID.

Endpoints

Method Endpoint Description
GET /api/v1/vehicles/documents/:documentId Returns the vehicle document referring to the given ID.
PUT /api/v1/countries/:countryId Updates the country referring to the given ID.
DELETE /api/v1/vehicles/documents/:statusId Deletes the vehicle document referring to the given ID.

Payloads

Returns the vehicle document referring to the given ID

Response
{
    "id": "ebd428a5-3f29-4bd2-a337-6bfeadbe187c",
    "chassisNumber": "KLATF08YIVB363636",
    "exerciseYear": 2022,
    "modelYear": 2022,
    "manufactureYear": 2022,
    "registrationNumber": "481014772",
    "color": "White",
    "make": "Volkswagen",
    "model": "Gol",
    "plate": "P688CC",
    "updatedAt": "2024-06-03T23:59:55.822501",
    "vehicleId": "b87d1704-c957-4ee2-b378-f7be43c10b85"
}

Updates the country referring to the given ID

Request
{
  "name": "Brasil",
  "alpha2": "BR",
  "alpha3": "BRA",
  "numeric3": "076"
}
Response
{
  "id": "cd2aafe9-a9ed-4a91-829d-de1fd97b0768",
  "name": "Brasil",
  "alpha2": "BR",
  "alpha3": "BRA",
  "numeric3": "076"
}

Deletes the vehicle document referring to the given ID

Response
{
    "id": "ebd428a5-3f29-4bd2-a337-6bfeadbe187c",
    "chassisNumber": "KLATF08YIVB363636",
    "exerciseYear": 2022,
    "modelYear": 2022,
    "manufactureYear": 2022,
    "registrationNumber": "481014772",
    "color": "White",
    "make": "Volkswagen",
    "model": "Gol",
    "plate": "P688CC",
    "updatedAt": "2024-06-03T23:59:55.822501",
    "vehicleId": "b87d1704-c957-4ee2-b378-f7be43c10b85"
}

Type of change

Checklist