import api from './api';

export interface DashboardData {
  revenueToday: number;
  adsToday: number;
  ticketAverage: number;
  paperOccupation: number;
  weeklyTrend: { day: string; amount: number }[];
  channelMix: { name: string; value: number }[];
  // Campos para vista de cajero o detalle
  myRevenue?: number;
  myAdsCount?: number;
  myPendingAds?: number;
}

export const dashboardService = {
  getStats: async (from?: string, to?: string): Promise<DashboardData> => {
    const response = await api.get<DashboardData>('/reports/dashboard', {
      params: { from, to }
    });
    return response.data;
  }
};