import {
  COMMERCE_KPIS,
  FORECAST_TREND_DATA,
  ORDERS_TREND_DATA,
  PAYMENT_BREAKDOWN_DATA,
  REVENUE_TREND_DATA,
  SALES_FUNNEL_STAGES,
  STORE_PERFORMANCE_DATA,
  TOP_PRODUCTS_DATA,
} from '../services/commerceService';
import type {CommerceFilterState} from '../types/commerce';

export class CommerceRepository {
  async getAnalytics(filters: CommerceFilterState) {
    // Simulates an API call
    await new Promise((r) => setTimeout(r, 100));
    return {
      kpis: COMMERCE_KPIS,
      revenueTrend: REVENUE_TREND_DATA,
      ordersTrend: ORDERS_TREND_DATA,
      funnel: SALES_FUNNEL_STAGES,
      paymentBreakdown: PAYMENT_BREAKDOWN_DATA,
      storePerformance: STORE_PERFORMANCE_DATA,
      topProducts: TOP_PRODUCTS_DATA,
      forecast: FORECAST_TREND_DATA,
    };
  }
}

export const commerceRepository = new CommerceRepository();
