# Auto-generated by DjangoCFG - see CLAUDE.md

from __future__ import annotations
import datetime
from typing import Any

from pydantic import BaseModel, ConfigDict, Field


class CentrifugoToken(BaseModel):
    """
    Nested serializer for Centrifugo WebSocket connection token.

    Response model (includes read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    token: str = Field(description='JWT token for Centrifugo WebSock...')
    centrifugo_url: str = Field(description='Centrifugo WebSocket URL')
    expires_at: datetime.datetime = Field(description='Token expiration time (ISO 8601)')
    channels: list[str] = Field(description='List of allowed channels for thi...')



class User(BaseModel):
    """
    Serializer for user details.

    Response model (includes read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    id: int = ...
    email: str = ...
    first_name: str | None = Field(None, max_length=50)
    last_name: str | None = Field(None, max_length=50)
    full_name: Any = Field(description="Get user's full name.")
    initials: Any = Field(description="Get user's initials for avatar f...")
    display_username: Any = Field(description='Get formatted username for display.')
    company: str | None = Field(None, max_length=100)
    phone: str | None = Field(None, max_length=20)
    position: str | None = Field(None, max_length=100)
    avatar: str | None = None
    is_staff: bool = Field(description='Designates whether the user can ...')
    is_superuser: bool = Field(description='Designates that this user has al...')
    date_joined: datetime.datetime = ...
    last_login: datetime.datetime | None = None
    unanswered_messages_count: int = ...
    centrifugo: CentrifugoToken | None = None



class CfgAccountsProfileAvatarCreateRequest(BaseModel):
    """
    
    Request model (no read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    avatar: Any = Field(description='Avatar image file (JPEG, PNG, GI...')



class AccountDeleteResponse(BaseModel):
    """
    Response serializer for account deletion.

    Response model (includes read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    success: bool = Field(description='Whether the account was successf...')
    message: str = Field(description='Human-readable message about the...')



class UserProfileUpdateRequest(BaseModel):
    """
    Serializer for updating user profile.

    Request model (no read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    first_name: str | None = Field(None, max_length=50)
    last_name: str | None = Field(None, max_length=50)
    company: str | None = Field(None, max_length=100)
    phone: str | None = Field(None, max_length=20)
    position: str | None = Field(None, max_length=100)



class PatchedUserProfileUpdateRequest(BaseModel):
    """
    Serializer for updating user profile.

    Request model (no read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    first_name: str | None = Field(None, max_length=50)
    last_name: str | None = Field(None, max_length=50)
    company: str | None = Field(None, max_length=100)
    phone: str | None = Field(None, max_length=20)
    position: str | None = Field(None, max_length=100)



