from dataclasses import dataclass, field
from uuid import UUID


@dataclass(frozen=True)
class PathwayCompoundDTO:
    pk: int
    name: str
    smiles: str | None = None
    cas_number: str | None = None
    ec_number: str | None = None


@dataclass(frozen=True)
class PathwayScenarioDTO:
    scenario_uuid: UUID
    name: str
    additional_info: list = field(default_factory=list)  # EnviPyModel instances


@dataclass(frozen=True)
class PathwayNodeDTO:
    node_uuid: UUID
    compound_pk: int
    name: str
    depth: int
    smiles: str | None = None
    cas_number: str | None = None
    ec_number: str | None = None
    additional_info: list = field(default_factory=list)  # EnviPyModel instances
    scenarios: list[PathwayScenarioDTO] = field(default_factory=list)


@dataclass(frozen=True)
class PathwayEdgeDTO:
    edge_uuid: UUID
    start_compound_pks: list[int] = field(default_factory=list)
    end_compound_pks: list[int] = field(default_factory=list)
    probability: float | None = None


@dataclass(frozen=True)
class PathwayModelInfoDTO:
    model_name: str | None = None
    model_uuid: UUID | None = None
    software_name: str | None = None
    software_version: str | None = None


@dataclass(frozen=True)
class PathwayExportDTO:
    pathway_uuid: UUID
    pathway_name: str
    compounds: list[PathwayCompoundDTO] = field(default_factory=list)
    nodes: list[PathwayNodeDTO] = field(default_factory=list)
    edges: list[PathwayEdgeDTO] = field(default_factory=list)
    root_compound_pks: list[int] = field(default_factory=list)
    model_info: PathwayModelInfoDTO | None = None
