"""
小程序备注相关 Pydantic 模型。

覆盖：备注创建请求、备注输出等场景。
"""

from __future__ import annotations

from pydantic import Field

from app.schemas.base import CamelModel


class NoteCreateRequest(CamelModel):
    """创建备注请求（含手动评分：再次服务意愿 + 再来店可能性，各 1-5；备注星星评分 1-5）。"""

    target_type: str = Field(default="member")
    target_id: int
    content: str = Field(..., min_length=1)
    task_id: int | None = None
    rating_service_willingness: int | None = Field(None, ge=1, le=5, description="再次服务意愿（1-5）")
    rating_revisit_likelihood: int | None = Field(None, ge=1, le=5, description="再来店可能性（1-5）")
    score: int | None = Field(None, ge=1, le=5, description="备注星星评分（1-5）")


class NoteOut(CamelModel):
    """备注输出模型（含评分 + AI 评分）。"""

    id: int
    type: str
    content: str
    rating_service_willingness: int | None
    rating_revisit_likelihood: int | None
    score: int | None
    ai_score: int | None
    ai_analysis: str | None
    task_id: int | None
    created_at: str
    updated_at: str
