/**
 * Ludo Master Types Definition
 */

export interface UserProfile {
  uid: string;
  name: string;
  email: string;
  phone: string;
  referralCode: string;
  balance: number;
  winningBalance: number;
  matchesPlayed: number;
  referralsCount: number;
  totalEarnings: number;
}

export type MatchCategory = 'SPECIAL' | 'REGULAR' | 'AUTOMATIC';
export type MatchStatus = 'ACTIVE' | 'FULL' | 'CLOSED' | 'COMPLETED';

export interface Match {
  id: string;
  title: string;
  time: string;
  gameName: string; // e.g. "Ludo King"
  category: MatchCategory;
  winningPrize: number;
  entryFee: number;
  playersJoined: number;
  totalPlayersNeeded: number;
  status: MatchStatus;
  roomCode?: string;
  winnerName?: string;
  userJoinedName?: string;
}

export type TransactionType = 
  | 'DEPOSIT' 
  | 'WITHDRAW' 
  | 'ENTRY_FEE' 
  | 'WINNINGS' 
  | 'GIFT_SENT' 
  | 'GIFT_RECEIVED';

export type TransactionStatus = 'PENDING' | 'SUCCESS' | 'FAILED';

export interface Transaction {
  id: string;
  type: TransactionType;
  amount: number;
  date: string;
  status: TransactionStatus;
  description: string;
  paymentChannel?: 'bKash' | 'Nagad' | 'Rocket' | 'Wallet Transfer';
  accountNo?: string;
  transactionId?: string;
}

export interface ChatMessage {
  id: string;
  sender: 'user' | 'bot';
  text: string;
  timestamp: string;
}

export interface LeaderboardEntry {
  rank: number;
  name: string;
  matchesPlayed: number;
  earnings: number;
  badge?: string; // e.g. "Grandmaster"
  isCurrentUser?: boolean;
}
