/**
 * Database Analytics Types
 * For growth trends, entity comparisons, and health checks
 */

// Growth Trends
export interface GrowthTrendDataPoint {
  period: string;
  parks_added: number;
  rides_added: number;
  companies_added: number;
  ride_models_added: number;
  photos_added: number;
  total_added: number;
}

export type GranularityType = 'daily' | 'weekly' | 'monthly';

// Entity Comparisons
export interface TopParkByRides {
  park_name: string;
  park_slug: string;
  ride_count: number;
  photo_count: number;
}

export interface TopManufacturer {
  manufacturer_name: string;
  slug: string;
  ride_count: number;
  model_count: number;
}

export interface TopOperator {
  operator_name: string;
  slug: string;
  park_count: number;
  ride_count: number;
}

export interface TopDesigner {
  designer_name: string;
  slug: string;
  ride_count: number;
}

export interface TopParkByPhotos {
  park_name: string;
  park_slug: string;
  photo_count: number;
}

export interface TopRideByPhotos {
  ride_name: string;
  ride_slug: string;
  park_slug: string;
  photo_count: number;
}

export interface EntityComparisons {
  top_parks_by_rides: TopParkByRides[];
  top_manufacturers: TopManufacturer[];
  top_operators: TopOperator[];
  top_designers: TopDesigner[];
  top_parks_by_photos: TopParkByPhotos[];
  top_rides_by_photos: TopRideByPhotos[];
}

// Database Health
export type HealthSeverity = 'critical' | 'warning' | 'info';

export interface HealthIssue {
  severity: HealthSeverity;
  category: string;
  count: number;
  entity_ids: string[];
  description: string;
  suggested_action: string;
}

export interface DatabaseHealthData {
  overall_score: number;
  critical_issues: number;
  warning_issues: number;
  info_issues: number;
  issues: HealthIssue[];
  checked_at: string;
}
