// Auto-generated by DjangoCFG - see CLAUDE.md
import * as Enums from "../enums";

/**
 * Serializer for OTP request.
 * 
 * Request model (no read-only fields).
 */
export interface OTPRequestRequest {
  /** Email address or phone number for OTP delivery */
  identifier: string;
  /** Delivery channel: 'email' or 'phone'. Auto-detected if not provided.

  * `email` - Email
  * `phone` - Phone */
  channel?: Enums.OTPRequestRequestChannel;
  /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
  source_url?: string;
}

/**
 * OTP request response.
 * 
 * Response model (includes read-only fields).
 */
export interface OTPRequestResponse {
  /** Success message */
  message: string;
}

/**
 * Error response for OTP operations.
 * 
 * Response model (includes read-only fields).
 */
export interface OTPErrorResponse {
  /** Error message */
  error: string;
}

/**
 * Serializer for OTP verification.
 * 
 * Request model (no read-only fields).
 */
export interface OTPVerifyRequest {
  /** Email address or phone number used for OTP request */
  identifier: string;
  otp: string;
  /** Delivery channel: 'email' or 'phone'. Auto-detected if not provided.

  * `email` - Email
  * `phone` - Phone */
  channel?: Enums.OTPRequestRequestChannel;
  /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
  source_url?: string;
}

/**
 * OTP verification response. When 2FA is required: - requires_2fa: True -
 * session_id: UUID of 2FA verification session - refresh/access/user: null
 * When 2FA is not required: - requires_2fa: False - session_id: null -
 * refresh/access/user: populated
 * 
 * Response model (includes read-only fields).
 */
export interface OTPVerifyResponse {
  /** Whether 2FA verification is required */
  requires_2fa?: boolean;
  /** 2FA session ID (if requires_2fa is True) */
  session_id?: string | null;
  /** JWT refresh token (if requires_2fa is False) */
  refresh?: string | null;
  /** JWT access token (if requires_2fa is False) */
  access?: string | null;
  user?: User | null;
  /** Whether user should be prompted to enable 2FA */
  should_prompt_2fa?: boolean;
}

/**
 * Serializer for user details.
 * 
 * Response model (includes read-only fields).
 */
export interface User {
  id: number;
  email: string;
  first_name?: string;
  last_name?: string;
  /** Get user's full name. */
  full_name: string;
  /** Get user's initials for avatar fallback. */
  initials: string;
  /** Get formatted username for display. */
  display_username: string;
  company?: string;
  phone?: string;
  position?: string;
  avatar?: string | null;
  /** Designates whether the user can log into this admin site. */
  is_staff: boolean;
  /** Designates that this user has all permissions without explicitly assigning them. */
  is_superuser: boolean;
  date_joined: string;
  last_login?: string | null;
  unanswered_messages_count: number;
  centrifugo: CentrifugoToken | null;
}

/**
 * Nested serializer for Centrifugo WebSocket connection token.
 * 
 * Response model (includes read-only fields).
 */
export interface CentrifugoToken {
  /** JWT token for Centrifugo WebSocket connection */
  token: string;
  /** Centrifugo WebSocket URL */
  centrifugo_url: string;
  /** Token expiration time (ISO 8601) */
  expires_at: string;
  /** List of allowed channels for this user */
  channels: Array<string>;
}

