from __future__ import annotations

from pydantic import BaseModel, Field


class KnowledgeStatusRequest(BaseModel):
    open: bool


class KnowledgeLifecycleRequest(BaseModel):
    status: str = Field(pattern="^(active|archived)$")


class KnowledgeMetadataUpdateRequest(BaseModel):
    name: str = Field(min_length=1, max_length=100)
    knowledgeType: str = Field(pattern="^(course|qa|general|fixed)$")


class KnowledgeBatchMetadataUpdateRequest(BaseModel):
    knowledgeIds: list[int] = Field(min_length=1, max_length=500)
    knowledgeType: str | None = Field(default=None, pattern="^(course|qa|general|fixed)$")


class KnowledgeBatchSyncRequest(BaseModel):
    knowledgeIds: list[int] = Field(min_length=1, max_length=500)


class AttentionUpdateRequest(BaseModel):
    status: str = Field(pattern="^(pending|processing|resolved|ignored)$")
    note: str | None = Field(default=None, max_length=2000)
