import api from '../../../shared/utils/api';

export interface EvolutionStatistics {
  totalExperiences: number;
  activeExperiences: number;
  pendingExperiences: number;
  approvedExperiences: number;
  topExperienceTypes: { type: string; count: number }[];
}

export interface HealthMetric {
  name: string;
  value: number;
  threshold: number;
  status: string;
}

export interface HealthReport {
  overall: string;
  metrics: HealthMetric[];
  recommendations: string[];
}

export const dashboardApi = {
  getEvolutionStatistics: async (): Promise<EvolutionStatistics> => {
    const response = await api.get('/evolution/statistics');
    return response.data.data;
  },

  getSystemHealth: async (): Promise<HealthReport> => {
    const response = await api.get('/evolution/health');
    return response.data.data;
  },
};
