|
- 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: int = Form(...)
- FuelRefilled: int = Form(...)
- GasStationName: str = Form(...)
- ImageBefore: UploadFile = Form(...)
- ImageAfter: UploadFile = Form(...)
- model_config={
- "arbitrary_types_allowed": True
- }
-
- class OutputFuelingTask(BaseModel):
- VehicleId: int = Field(...)
- Description: str = Field(...)
- Date: datetime = Field(...)
- Cost: int = Field(...)
- FuelRefilled: int = Field(...)
- GasStationName: str = Field(...)
- Driver: ShowDriver | None
- ImageBefore: str = Field(...)
- ImageAfter: str = Field(...)
- model_config={
- "arbitrary_types_allowed": True
- }
|