from uuid import UUID
from datetime import datetime
from pydantic import BaseModel, Field
from typing import List, Optional


class UserPrivilege(BaseModel):
    id: int
    code: str
    name: str
    description: str
    is_active: bool
    created_at: datetime


class UserRoleData(BaseModel):
    user_id: UUID = Field(..., description="ID пользователя")
    user_privilege: Optional[UserPrivilege] = Field(None, description="Привилегия пользователя")
    user_permissions: List[str] = Field(default_factory=list, description="Список кодов прав")

class UserRoleResponse(BaseModel):
    status: str
    data: UserRoleData
