from pydantic import BaseModel
from typing import Any, Dict, Optional
from auth.models import StaffPermissions


class StaffCreate(BaseModel):
    email: str
    password: str
    name: str
    role: str  # sysadmin, admin, editor, user
    permissions: Optional[StaffPermissions] = None


class StaffUpdate(BaseModel):
    email: Optional[str] = None
    name: Optional[str] = None
    role: Optional[str] = None
    is_active: Optional[bool] = None
    permissions: Optional[StaffPermissions] = None


class StaffPasswordUpdate(BaseModel):
    new_password: str


class StaffResponse(BaseModel):
    id: str
    email: str
    name: str
    role: str
    is_active: bool
    permissions: Optional[dict] = None


class StaffListResponse(BaseModel):
    staff: list[StaffResponse]
    total: int


class PreferencesUpdate(BaseModel):
    prefs: Dict[str, Any]
