import {scopedEndpoint} from '@/shared/services/httpClient';
import type {Endpoint, Scope} from '@/shared/services/httpClient';
import type {Reward} from '@/features/lyts/types/reward';
import type {ActivityEvent, TimePoint} from '@/features/dashboard/types/dashboard';

/** LYT reward endpoints. See dashboardRepository for the layer's contract. */
export const lytsRepository = {
  rewards: (scope: Scope): Endpoint<Reward[]> =>
    scopedEndpoint('/api/lyts/rewards', scope),

  redemptions: (scope: Scope): Endpoint<TimePoint[]> =>
    scopedEndpoint('/api/lyts/redemptions', scope),

  activity: (scope: Scope): Endpoint<ActivityEvent[]> =>
    scopedEndpoint('/api/lyts/activity', scope),
};
