from pydantic import BaseModel
from typing import List, Optional


class UserEntity(BaseModel):
    id: Optional[int] = None
    first_name: str
    last_name: str
    login: str
    password: str
    role_id: Optional[int] = None
    role_name: Optional[str] = None
    total_orders: List[int] = []

    class Config:
        from_attributes = True
