import uuid
import datetime
from dataclasses import dataclass, field
from typing import List

from cc_py_commons.loads.location import Location
from cc_py_commons.loads.equipment import Equipment
from cc_py_commons.loads.freighthub_contact import FreightHubContact

@dataclass
class Load:
    reference_number: str
    # C4 Account ID
    customer_id: int
    origin: Location
    destination: Location
    pickup_date: datetime.date
    delivery_date: datetime.date
    status_id: uuid.UUID
    source_id: uuid.UUID
    equipment: List[Equipment]
    equipment_description: str     
    contact: FreightHubContact    
    pickup_open_time: datetime.time = field(default=None)
    pickup_close_time: datetime.time = field(default=None)
    pickup_appointment_required: bool = field(default=False)
    delivery_open_time: datetime.time = field(default=None)
    delivery_close_time: datetime.time = field(default=None)
    delivery_appointment_required: bool = field(default=False)
    tracking_number: str = field(default=None)
    full_load: bool = field(default=True)
    length: int = field(default=None)
    width: int = field(default=None)
    height: int = field(default=None)
    weight: int = field(default=None)
    load_count: int = field(default=None)
    distance: int = field(default=None)
    stops: int = field(default=None)
    rate: str = field(default=None)
    declared_value: int = field(default=None)
    comment: str = field(default=None)
    commodity: str = field(default=None)
    min_temperature: float = field(default=None)
    max_temperature: float = field(default=None)
    tarp_size: int = field(default=None)
    carrier_id: uuid.UUID = field(default=None)
    contact_id: uuid.UUID = field(default=None)
    url: str = field(default=None)
    demo_load: bool = field(default=False)
    team_service_required: bool = field(default=False)
    quote_id: uuid.UUID = field(default=None)
    truck_lane_search_id: uuid.UUID = field(default=None)
    truck_search_id: uuid.UUID = field(default=None)
    # generated by server and returned
    id: uuid.UUID = field(default=None)
    # generated by server and returned
    load_number: str = field(default=None)
    mcleod_movement_id: int = field(default=None)
