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 Creator: int | 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(...) Creator: int | None FuelRefilled: float = Field(...) GasStationName: str = Field(...) Driver: ShowDriver | None class OutputFuelingTaskList(BaseModel): FuelingTasks: list[OutputFuelingTaskMin]