from pydantic import BaseModel
from typing import Optional, List
from datetime import datetime


class DeliveryOrderEntity(BaseModel):
    id: Optional[int] = None
    order_datetime: datetime
    count_trucks: int
    deadline: datetime
    price: float
    estimated_route_time_in_minutes: Optional[int] = None
    route: Optional[List[List[float]]] = None
    truck_name: Optional[str] = None
    truck_capacity: Optional[float] = None
    truck_id: Optional[int] = None
    total_order_id: Optional[int] = None

    class Config:
        from_attributes = True
