/**
 * Route factory for web API service
 * Creates routes with access to the service container
 */

import { Hono } from 'hono';
import type { IServiceContainer } from '@stock-bot/handlers';
import { createHealthRoutes } from './health.routes';
import { createExchangeRoutes } from './exchange.routes';
import { createMonitoringRoutes } from './monitoring.routes';
import { createPipelineRoutes } from './pipeline.routes';

export function createRoutes(container: IServiceContainer): Hono {
  const app = new Hono();

  // Create routes with container
  const healthRoutes = createHealthRoutes(container);
  const exchangeRoutes = createExchangeRoutes(container);
  const monitoringRoutes = createMonitoringRoutes(container);
  const pipelineRoutes = createPipelineRoutes(container);

  // Mount routes
  app.route('/health', healthRoutes);
  app.route('/api/exchanges', exchangeRoutes);
  app.route('/api/system/monitoring', monitoringRoutes);
  app.route('/api/pipeline', pipelineRoutes);

  return app;
}