[Vehicles] Implementation (Router) #195

Closed
opened 2026-01-19 22:51:29 +00:00 by duarteneves5 · 1 comment
duarteneves5 commented 2026-01-19 22:51:29 +00:00 (Migrated from github.com)

Create src/routers/vehicles.py.

Endpoints:

  • POST /: Create a new vehicle.
    • Input: VehicleCreate (includes clientId).
    • Logic: Call repo.create_vehicle().
  • GET /{id}: Retrieve a vehicle by ObjectId.
  • GET /: List vehicles OR Find by Filter.
    • If ?license_plate={val} -> Call repo.get_by_license_plate.
    • If ?client_id={val} -> Call repo.get_by_client_id.
  • PATCH /{id}: Update vehicle details.
    • Input: VehicleUpdate (Restricted to Kilometers).
    • Call repo.update().
  • DELETE /{id}: Delete vehicle.
    • Call repo.delete().
Create `src/routers/vehicles.py`. **Endpoints:** - **POST /**: Create a new vehicle. - Input: `VehicleCreate` (includes `clientId`). - Logic: Call `repo.create_vehicle()`. - **GET /{id}**: Retrieve a vehicle by ObjectId. - **GET /**: List vehicles OR Find by Filter. - If `?license_plate={val}` -> Call `repo.get_by_license_plate`. - If `?client_id={val}` -> Call `repo.get_by_client_id`. - **PATCH /{id}**: Update vehicle details. - Input: `VehicleUpdate` (Restricted to Kilometers). - Call `repo.update()`. - **DELETE /{id}**: Delete vehicle. - Call `repo.delete()`.
AndreFerreira5 commented 2026-01-22 23:18:17 +00:00 (Migrated from github.com)

this issue has already been integrated in the maion branch, closing...

this issue has already been integrated in the maion branch, closing...
Sign in to join this conversation.
No description provided.