Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

fuelingtask.py 908 B

12345678910111213141516171819202122232425262728293031
  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. }