export interface Dashboard {
  statistics_data: DashboardStatisticsData[];
  charts: DashboardComparisonCharts | DashboardOverviewCharts;
}

export interface DashboardComparisonCharts {
  farm: DashboardCharts;
  flock: DashboardCharts;
  kandang: DashboardCharts;
}

export interface DashboardOverviewCharts {
  body_weight: DashboardCharts;
  performance: DashboardCharts;
  fcr: DashboardCharts;
  quality_control: DashboardCharts;
  deplesi: DashboardCharts;
}

export interface DashboardCharts {
  series: DashboardChartsSeries[];
  dataset: DashboardChartsDataset[];
}

export interface DashboardStatisticsData {
  label: string;
  value: number;
  percent_last_month: number;
}

export interface DashboardChartsDataset {
  week: number;
  // Index signature to support dynamic keys (series IDs) in comparison mode
  [key: string | number]: number | undefined;
}

export interface DashboardChartsSeries {
  id: string | number;
  label: string;
  unit: string;
}

export interface DashboardFilter {
  start_date: string;
  end_date: string;
  analysis_mode: 'OVERVIEW' | 'COMPARISON';
  location_ids: number[];
  comparison_type?: string | undefined;
  flock_ids: number[];
  kandang_ids: number[];
}

export interface DashboardMeta {
  page: number;
  limit: number;
  total_pages: number;
  total_results: number;
  filters: DashboardFilter;
}
