"""LeAudit 交叉评查提案模型。"""

from __future__ import annotations

from sqlalchemy import BigInteger, Numeric, String, Text
from sqlalchemy.orm import Mapped, mapped_column

from fastapi_common.fastapi_common_web.models import BaseModel


class LeauditCrossReviewProposal(BaseModel):
    """交叉评查提案表。"""

    __tablename__ = "leaudit_cross_review_proposals"

    Id: Mapped[int] = mapped_column("id", BigInteger, primary_key=True, autoincrement=True)
    taskId: Mapped[int] = mapped_column("task_id", BigInteger, comment="任务ID")
    documentId: Mapped[int] = mapped_column("document_id", BigInteger, comment="文档ID")
    ruleResultId: Mapped[int] = mapped_column("rule_result_id", BigInteger, comment="结果项ID")
    proposerId: Mapped[int] = mapped_column("proposer_id", BigInteger, comment="提案人ID")
    proposedScoreDelta: Mapped[float] = mapped_column("proposed_score_delta", Numeric(10, 2), comment="分数变化量")
    reason: Mapped[str] = mapped_column(Text, comment="提案理由")
    status: Mapped[str] = mapped_column(String(32), default="pending", comment="pending/approved/rejected")
