import { queryOptions } from '@tanstack/react-query';
import { getMasterOptions } from './service';
import type { MasterOptionsFilters } from './types';

export const masterOptionKeys = {
  all: ['foundation', 'master-options'] as const,
  list: (filters: MasterOptionsFilters) => [...masterOptionKeys.all, 'list', filters] as const
};

export const masterOptionsQueryOptions = (filters: MasterOptionsFilters) =>
  queryOptions({
    queryKey: masterOptionKeys.list(filters),
    queryFn: () => getMasterOptions(filters)
  });
