/**
 * @ai-summary Configuration API routes
 * @ai-context Exposes feature tier configuration for frontend consumption
 */

import { FastifyPluginAsync } from 'fastify';
import { getAllFeatureConfigs, TIER_LEVELS } from './feature-tiers';

export const configRoutes: FastifyPluginAsync = async (fastify) => {
  // GET /api/config/feature-tiers - Get all feature tier configurations
  // Public endpoint - no auth required (config is not sensitive)
  fastify.get('/config/feature-tiers', async (_request, reply) => {
    return reply.code(200).send({
      tiers: TIER_LEVELS,
      features: getAllFeatureConfigs(),
    });
  });
};
