"""页级图片质量 VO。"""

from pydantic import BaseModel, Field


class PageQualityPageResultVO(BaseModel):
    """单页模糊检测结果。"""

    pageNum: int = Field(..., description="页码")
    qualityStatus: str = Field(..., description="pass/review/reject")
    qualityScore: float | None = Field(None, description="分值")
    reasonText: str | None = Field(None, description="原因说明")


class PageQualitySummaryVO(BaseModel):
    """文档页级模糊检测摘要。"""

    runId: int | None = Field(None, description="最新运行ID")
    runStatus: str | None = Field(None, description="运行状态")
    summaryStatus: str | None = Field(None, description="摘要状态")
    totalPages: int = Field(0, description="总页数")
    reviewPageCount: int = Field(0, description="疑似模糊页数")
    rejectPageCount: int = Field(0, description="建议重拍页数")
    warningText: str | None = Field(None, description="汇总提示文案")
    pages: list[int] = Field(default_factory=list, description="问题页码列表")
    finishedAt: str | None = Field(None, description="完成时间")


class PageQualityDetailVO(BaseModel):
    """文档页级模糊检测详情。"""

    summary: PageQualitySummaryVO = Field(..., description="摘要")
    results: list[PageQualityPageResultVO] = Field(default_factory=list, description="页结果")


class PageQualityRecheckVO(BaseModel):
    """手工重检响应。"""

    runId: int = Field(..., description="运行ID")
    documentId: int = Field(..., description="文档ID")
    status: str = Field(..., description="queued/running")
