export enum LoginType {
  OTP = 1,
  Google = 2,
  Apple = 3,
  Normal = 4,
}

/** Matches the full object inside result[] from the login / get_profile API */
export interface AuthUser {
  // Core identity
  id: number;
  channel_id: string;
  channel_name: string;
  full_name: string;
  email: string;
  mobile_number: string;
  country_code: string;
  country_name: string;
  type?: number;

  // Profile media
  image: string;
  image_storage_type?: number;
  cover_img?: string;
  cover_img_storage_type?: number;

  // Profile info
  description?: string;
  website?: string;
  facebook_url?: string;
  instagram_url?: string;
  twitter_url?: string;
  address?: string;
  city?: string;
  state?: string;
  country?: string;
  pincode?: number;
  reference_code?: string;

  // Device
  device_type?: number;
  device_token?: string;

  // Wallet & earnings
  wallet_balance?: number;
  wallet_earning?: number;

  // Account verification & bank
  is_account_verify?: number;
  bank_name?: string;
  bank_code?: string;
  bank_address?: string;
  ifsc_no?: string;
  account_no?: string;
  front_id_proof?: string;
  front_id_proof_storage_type?: number;
  back_id_proof?: string;
  back_id_proof_storage_type?: number;

  // Notifications & status
  push_notification_status?: number;
  send_mail_status?: number;
  user_penal_status?: number;
  status?: number;

  // PayPal
  paypal_email?: string;
  paypal_name?: string;

  // Subscription / package
  is_buy?: number;
  package_name?: string;
  package_price?: string;
  package_image?: string;
  ads_free?: string;
  download_content?: string;
  background_play?: string;

  // Timestamps
  created_at?: string;
  updated_at?: string;

  // Auth token
  stream_token: string;

  // Firebase custom token — used to authenticate with Firebase Auth after login
  firebase_id?: string;
}

export interface LoginPayload {
  type: LoginType;
  email?: string;
  password?: string;
  full_name?: string;
  image?: string;
  mobile_number?: string;
  country_code?: string;
  country_name?: string;
  device_type?: string;
  device_token?: string;
  firebase_id?: string;
}

export interface RegisterPayload {
  full_name: string;
  email: string;
  password: string;
  country_code: string;
  country_name: string;
  mobile_number: string;
  image?: string;
}

export interface AuthState {
  user: AuthUser | null;
  isAuthenticated: boolean;
  isLoading: boolean;
  error: string | null;
}
