from __future__ import annotations

from pydantic import BaseModel, Field


class GEODiagnosisTriggerRequest(BaseModel):
    force_refresh: bool = Field(default=False)


class GEODiagnosisTaskResponse(BaseModel):
    task_id: str
    brand_id: str
    status: str


class GEODimensionItemResponse(BaseModel):
    name: str
    status: str
    description: str
    suggestion: str
    score: float
    max_score: float


class GEODimensionResponse(BaseModel):
    name: str
    score: float
    max_score: float
    percentage: float
    status: str
    items: list[GEODimensionItemResponse]
    detail: dict


class GEORecommendationResponse(BaseModel):
    priority: str
    dimension: str
    title: str
    description: str
    impact: str
    effort: str


class GEODiagnosisResponse(BaseModel):
    overall_score: float
    health_level: str
    health_level_label: str
    dimensions: list[GEODimensionResponse]
    recommendations: list[GEORecommendationResponse]
    is_full_report: bool = False


class GEODiagnosisResultResponse(BaseModel):
    task_id: str
    brand_id: str
    status: str
    result: GEODiagnosisResponse | None = None
    error: str | None = None


class GEODiagnosisHistoryItem(BaseModel):
    task_id: str
    overall_score: float
    health_level: str
    created_at: str
    completed_at: str | None = None


class GEODiagnosisHistoryResponse(BaseModel):
    brand_id: str
    history: list[GEODiagnosisHistoryItem]
