export type StatsPeriod = 'week' | 'month' | 'quarter' | 'year';

export interface StatsSummary {
  totalTrainings: number;
  completedTrainings: number;
  cancelledTrainings: number;
  totalClients: number;
  newClients: number;
  totalSalesAmount: number;
  paidSalesAmount: number;
  upcomingTrainings: number;
  sleepingClients: number;
}

export interface TrainerFunnelBreakdown {
  trainerId: string;
  firstName: string;
  lastName: string;
  totalNew: number;
  totalAssigned: number;
  totalCompleted: number;
  totalRegular: number;
  newToAssigned: number;
  assignedToCompleted: number;
  completedToRegular: number;
}

export interface FunnelConversion {
  newToAssigned: number;
  assignedToCompleted: number;
  completedToRegular: number;
  totalNew: number;
  totalAssigned: number;
  totalCompleted: number;
  totalRegular: number;
  perTrainer: TrainerFunnelBreakdown[];
}

export interface RatingEntry {
  userId: string;
  firstName: string;
  lastName: string;
  avatarUrl?: string;
  rank: number;
  score: number;
  totalTrainings: number;
  totalSalesAmount: number;
  totalClients: number;
  completedTrainings: number;
  cancelledTrainings: number;
}

export interface TrainerDetailedStats {
  trainerId: string;
  trainings: {
    total: number;
    planned: number;
    confirmed: number;
    completed: number;
    cancelled: number;
    noShow: number;
  };
  sales: {
    totalAmount: number;
    paidAmount: number;
    pendingAmount: number;
    count: number;
  };
  funnel: {
    totalNew: number;
    totalAssigned: number;
    totalCompleted: number;
    totalRegular: number;
    newToAssigned: number;
    assignedToCompleted: number;
    completedToRegular: number;
  };
  clientCount: number;
}

export interface StatsDateParams {
  dateFrom?: string;
  dateTo?: string;
  trainerId?: string;
}
