/**
 * QM Exchanges Operations - Simple exchange data fetching
 */

import type { IServiceContainer } from '@stock-bot/handlers';

export async function fetchExchanges(services: IServiceContainer): Promise<any[]> {
  // Get exchanges from MongoDB
  const exchanges = await services.mongodb.collection('qm_exchanges').find({}).toArray();

  return exchanges;
}

export async function getExchangeByCode(services: IServiceContainer, code: string): Promise<any> {
  // Get specific exchange by code
  const exchange = await services.mongodb.collection('qm_exchanges').findOne({ code });

  return exchange;
}
