"""
用户管理 Schema — 管理员 CRUD（仅 zhipianren 可用）
"""

from pydantic import BaseModel, ConfigDict

from app.models.user import UserRole


class UserCreate(BaseModel):
    username: str
    display_name: str
    password: str
    role: UserRole
    profile_text: str | None = None


class UserUpdate(BaseModel):
    display_name: str | None = None
    role: UserRole | None = None
    profile_text: str | None = None
    is_active: bool | None = None


class UserResponse(BaseModel):
    id: int
    username: str
    display_name: str
    role: UserRole
    profile_text: str | None = None
    is_active: bool = True

    model_config = ConfigDict(from_attributes=True)