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.
 
 

31 rivejä
908 B

  1. from pydantic import BaseModel, Field
  2. from fastapi import Form, UploadFile
  3. from datetime import datetime
  4. from schemas.user import ShowDriver
  5. class CreateFuelingTask(BaseModel):
  6. VehicleId: int = Form(...)
  7. Description: str = Form(...)
  8. Date: datetime = Form(...)
  9. Cost: int = Form(...)
  10. FuelRefilled: int = Form(...)
  11. GasStationName: str = Form(...)
  12. ImageBefore: UploadFile = Form(...)
  13. ImageAfter: UploadFile = Form(...)
  14. model_config={
  15. "arbitrary_types_allowed": True
  16. }
  17. class OutputFuelingTask(BaseModel):
  18. VehicleId: int = Field(...)
  19. Description: str = Field(...)
  20. Date: datetime = Field(...)
  21. Cost: int = Field(...)
  22. FuelRefilled: int = Field(...)
  23. GasStationName: str = Field(...)
  24. Driver: ShowDriver | None
  25. ImageBefore: str = Field(...)
  26. ImageAfter: str = Field(...)
  27. model_config={
  28. "arbitrary_types_allowed": True
  29. }