from pydantic import BaseModel, Field
from datetime import datetime
from typing import List, Optional
from schemas.carpart import ShowCarPart
from schemas.user import ShowUser
from schemas.vehicle import OutputVehicle


class CreateMaintenanceJob(BaseModel):
    Description: str = Field(...)
    VehicleID: int = Field(...)
    Date: datetime = Field(...)


class OutputMaintenanceJob(BaseModel):
    Id: int
    Description: str
    Date: datetime
    CarPartsList: Optional[List[ShowCarPart]]
    TotalCost: float
    Vehicle: OutputVehicle
    FinishedBy: Optional[ShowUser]
    Status: str


class OutputMinimalMaintenanceJob(BaseModel):
    Id: int
    Description: str
    Date: datetime
    TotalCost: float
    Vehicle: OutputVehicle
    FinishedBy: Optional[ShowUser]
    Status: str