Closed StPfeffer closed 1 month ago
Implementation of the vehicle scope.
/api/v1/vehicles
/api/v1/vehicles/:vehicleId
{ "vehicles": [ { "id": "b87d1704-c957-4ee2-b378-f7be43c10b85", "name": "Volkswagen Gol", "initialMileage": 85, "actualMileage": 93, "createdAt": "2024-05-27T20:12:09.472329", "updatedAt": "2024-05-27T20:12:09.472329" } ], "results": 1 }
{ "id": "b87d1704-c957-4ee2-b378-f7be43c10b85", "name": "Volkswagen Gol", "initialMileage": 85, "actualMileage": 93, "createdAt": "2024-05-27T20:12:09.472329", "updatedAt": "2024-05-27T20:12:09.472329" }
The actualMileage field is optional. If it is not included in the request body, the value of initialMileage will be used instead.
actualMileage
initialMileage
{ "name": "Volkswagen Gol", "initialMileage": 85, "actualMileage": 93 }
cargo clippy --all -- -D warnings
cargo fmt
cargo test
mod.rs
Description
Implementation of the vehicle scope.
Endpoints
/api/v1/vehicles
/api/v1/vehicles/:vehicleId
/api/v1/vehicles
/api/v1/vehicles/:vehicleId
Payloads
List all vehicles
Response
Get a vehicle
Response
Create a vehicle
Request
The
actualMileage
field is optional. If it is not included in the request body, the value ofinitialMileage
will be used instead.Response
Delete a vehicle
Response
Type of change
Checklist
cargo clippy --all -- -D warnings
just before my last commit and fixed any issue that was found.cargo fmt
just before my last commit.cargo test
just before my last commit and all tests passed.mod.rs
file within its own folder, and in any parent folder(s).