/**
 * Analytics dashboard view model
 * Represents dashboard data for analytics
 *
 * Note: No matching generated DTO available yet
 */
export class AnalyticsDashboardViewModel {
  totalUsers: number;
  activeUsers: number;
  totalRaces: number;
  totalLeagues: number;

  constructor(data: { totalUsers: number; activeUsers: number; totalRaces: number; totalLeagues: number }) {
    this.totalUsers = data.totalUsers;
    this.activeUsers = data.activeUsers;
    this.totalRaces = data.totalRaces;
    this.totalLeagues = data.totalLeagues;
  }

  /** UI-specific: User engagement rate */
  get userEngagementRate(): number {
    return this.totalUsers > 0 ? (this.activeUsers / this.totalUsers) * 100 : 0;
  }

  /** UI-specific: Formatted engagement rate */
  get formattedEngagementRate(): string {
    return `${this.userEngagementRate.toFixed(1)}%`;
  }

  /** UI-specific: Activity level */
  get activityLevel(): string {
    if (this.userEngagementRate > 70) return 'High';
    if (this.userEngagementRate > 40) return 'Medium';
    return 'Low';
  }
}