You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
827 B

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