/**
 * Get the exchange suffix for EOD API calls based on country and exchange
 * US symbols use :US suffix, except EUFUND and GBOND which always use their own codes
 * Others use their actual exchange code
 */
export function getEodExchangeSuffix(exchange: string, country?: string): string {
  // Special cases that always use their own exchange code
  if (exchange === 'EUFUND' || exchange === 'GBOND') {
    return exchange;
  }
  // US symbols use :US suffix
  return country === 'USA' ? 'US' : exchange;
}

/**
 * Build symbol.exchange format for EOD API
 */
export function buildEodSymbol(symbol: string, exchange: string, country?: string): string {
  const suffix = getEodExchangeSuffix(exchange, country);
  return `${symbol}.${suffix}`;
}