import { createEntityHook } from './useEntityBase';
import { ENDPOINTS } from '@/constants/endpoints';
import i18n from "@/lib/i18n";

export type GoldSpreadRuleDTO = {
  id: string;
  name: string;
  product_id: string | null;
  purity_id: string | null;
  currency_id: string | null;
  buy_spread_percent: number;
  sell_spread_percent: number;
  min_spread_amount: number;
  is_active: boolean;
  starts_at: string | null;
  ends_at: string | null;
};

// Create the hook pointing to /gold-pricing/spread-rules
export const usePricing = createEntityHook<GoldSpreadRuleDTO, never, never>(
  i18n.t('hooks.usePricing.text_1'),
  '/gold-pricing/spread-rules',
);