# Auto-generated by DjangoCFG - see CLAUDE.md

from __future__ import annotations
import datetime
from typing import Any

from pydantic import BaseModel, ConfigDict, Field


class VerifyRequest(BaseModel):
    """
    Serializer for TOTP code verification during login.

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

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

    session_id: str = Field(description='2FA session ID from login response')
    code: str = Field(
    description='6-digit TOTP code from authentic...',
    min_length=6,
    max_length=6,
)



class TotpVerifyUser(BaseModel):
    """
    User data returned after 2FA verification.

    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 = ...



class VerifyResponse(BaseModel):
    """
    Response serializer for successful 2FA verification.

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

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

    message: str = ...
    access_token: str = Field(description='JWT access token')
    refresh_token: str = Field(description='JWT refresh token')
    user: TotpVerifyUser = ...
    remaining_backup_codes: int | None = Field(
    None,
    description='Number of remaining backup codes...',
)
    warning: str | None = Field(None, description='Warning message (e.g., low backu...')



class VerifyBackupRequest(BaseModel):
    """
    Serializer for backup code verification during login.

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

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

    session_id: str = Field(description='2FA session ID from login response')
    backup_code: str = Field(
    description='8-character backup recovery code',
    min_length=8,
    max_length=8,
)



