from __future__ import annotations

from dataclasses import dataclass
from pathlib import Path


@dataclass(frozen=True)
class ProjectCandidate:
    project_code: str
    project_name: str
    client_name: str
    location: str
    description: str
    project_type: str
    status: str
    priority: str
    progress_percent: int
    notes: str


@dataclass(frozen=True)
class DocumentTypeRule:
    document_type: str
    pattern: str
    match_scope: str
    priority: int
    task_type: str
    knowledge_type: str
    doc_stage: str
    doc_family: str
    required_for: tuple[str, ...]
    section_title: str
    issuer: str = ""
    signer: str = ""
    description: str = ""


@dataclass(frozen=True)
class ProjectDocument:
    project_code: str
    project_name: str
    project_root: str
    absolute_path: Path
    relative_path: str
    source_filename: str
    source_format: str
    folder_scope: str
    document_type: str
    classification_source: str
    matched_rule: str | None
    confidence: float
    task_type: str
    knowledge_type: str
    doc_stage: str
    doc_family: str
    required_for: tuple[str, ...]
    section_title: str
    issuer: str
    signer: str
    decision_no: str = ""
    issue_date: str = ""
    effective_date: str = ""
    tags: tuple[str, ...] = ()
    related_docs: tuple[str, ...] = ()
    compliance_refs: tuple[str, ...] = ()
    readiness_weight: float = 0.5
