import type { ApiResponse } from '@alqove/types';
import type { AlqoveClient } from '../client';

export interface SellerDashboardMetrics {
  revenue_this_month: { current_cents: number; prior_cents: number };
  active_listings:    { current: number; delta_last_7_days: number };
  orders_this_month:  { current: number; prior: number };
  next_payout:        { amount_cents: number | null; arrival_date: string | null };
  action_counts: {
    orders_overdue: number;
    orders_today: number;
    orders_this_week: number;
    listings_needs_attention: number;
  };
}

export function createSellerEndpoints(client: AlqoveClient) {
  return {
    dashboardMetrics(storeId: string) {
      return client.get<ApiResponse<SellerDashboardMetrics>>(
        `/v1/stores/${storeId}/dashboard/metrics`,
      );
    },
  };
}
