Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

vehicle.py 860 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. from typing import Optional
  2. from pydantic import BaseModel
  3. class CreateVehicle(BaseModel):
  4. Model: str
  5. Year: int
  6. LicensePlate: str
  7. Mileage: int
  8. Capacity: int
  9. class OutputVehicle(BaseModel):
  10. Id: int
  11. Model: str
  12. Year: int
  13. LicensePlate: str
  14. Mileage: int
  15. CurrentLocation: Optional[list[str]] = None
  16. Fuel: Optional[int] = 0
  17. MaintenanceNotes: Optional[list[str]] = None
  18. AssignedDriver: Optional[int] = None
  19. Capacity: int
  20. Status: str
  21. class UpdateVehicle(BaseModel):
  22. Model: str
  23. Year: int
  24. LicensePlate: str
  25. Capacity: int
  26. Mileage: int
  27. Status: str
  28. CurrentLocation: Optional[list[str]] = None
  29. Fuel: Optional[int] = 0
  30. MaintenanceNotes: Optional[list[str]] = None
  31. AssignedDriver: Optional[int] = None
  32. class VehicleLocation(BaseModel):
  33. CurrentLocation: list[str]