|
123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- from pydantic import BaseModel, Field
- from fastapi import Form, UploadFile
- from datetime import datetime
- from schemas.user import ShowDriver
-
-
- class CreateFuelingTask(BaseModel):
- VehicleId: int = Form(...)
- Description: str = Form(...)
- Date: datetime = Form(...)
- Cost: float = Form(...)
- FuelRefilled: float = Form(...)
- GasStationName: str = Form(...)
- ImageBefore: UploadFile = Form(...)
- ImageAfter: UploadFile = Form(...)
- model_config = {"arbitrary_types_allowed": True}
-
-
- class OutputFuelingTask(BaseModel):
- Id: int = Field(...)
- VehicleId: int = Field(...)
- Description: str = Field(...)
- Date: datetime = Field(...)
- Cost: float = Field(...)
- FuelRefilled: float = Field(...)
- GasStationName: str = Field(...)
- Driver: ShowDriver | None
- ImageBefore: str = Field(...)
- ImageAfter: str = Field(...)
- model_config = {"arbitrary_types_allowed": True}
-
-
- class OutputFuelingTaskMin(BaseModel):
- Id: int = Field(...)
- VehicleId: int = Field(...)
- Description: str = Field(...)
- Date: datetime = Field(...)
- Cost: float = Field(...)
- FuelRefilled: float = Field(...)
- GasStationName: str = Field(...)
- Driver: ShowDriver | None
-
-
- class OutputFuelingTaskList(BaseModel):
- FuelingTasks: list[OutputFuelingTaskMin]
|