from __future__ import annotations

from datetime import date
from typing import Optional

from pydantic import BaseModel, Field


class InquiryRequest(BaseModel):
    customer: str
    origin: str = "青岛港"
    destination: str = "洛杉矶港"
    cargo_name: str = "家电"
    cargo_volume: float = Field(default=2, gt=0)
    evaluation_date: date = date(2026, 7, 20)
    requested_departure_date: date = date(2026, 7, 27)
    max_transit_days: float = Field(default=21, gt=0)
    target_amount: float = Field(default=54000, gt=0)
    preferred_route_type: str = "直航"
    dangerous_goods: bool = False
    salesperson_adjustment: float = 0


class CandidateRecord(BaseModel):
    quote_uri: str
    quote_no: str
    product_uri: str
    product_code: str
    product_name: str
    brand_name: str = ""
    transport_mode: str = ""
    offering_uri: str
    offering_code: str = ""
    supplier_uri: str
    supplier_name: str
    schedule_uri: str = ""
    schedule_code: str = ""
    route_type: str = ""
    service_form: str = ""
    origin: str = ""
    destination: str = ""
    currency: str
    supplier_cost: float
    valid_from: Optional[date] = None
    valid_to: Optional[date] = None
    departure_date: Optional[date] = None
    arrival_date: Optional[date] = None
    transit_days: float = 0
    booking_success_rate: float = 0.8
    space_release_success_rate: float = 0.8
    etd_on_time_rate: float = 0.85
    eta_on_time_rate: float = 0.85
    supplier_active: bool = True
    capacity_available: bool = True
    supports_dangerous_goods: bool = False
    dangerous_goods_only: bool = False
    agency_level: str = ""
    offering_channel: str = ""
    capacity_commitment: str = ""
