// Analytics dashboard view model
// Represents dashboard data for analytics

export class AnalyticsDashboardViewModel {
  totalUsers: number;
  activeUsers: number;
  totalRaces: number;
  totalLeagues: number;

  constructor(data: { totalUsers: number; activeUsers: number; totalRaces: number; totalLeagues: number }) {
    Object.assign(this, data);
  }

  /** 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';
  }
}