import { Router, Request, Response } from 'express';
import { getPublicConfig } from '../config/system.config';
import { asyncHandler } from '../middlewares/errorHandler.middleware';

const router = Router();

/**
 * GET /api/v1/config
 * Returns public system configuration for frontend
 * No authentication required - only returns non-sensitive values
 */
router.get('/',
  asyncHandler(async (req: Request, res: Response): Promise<void> => {
    const config = await getPublicConfig();
    res.json({
      success: true,
      data: config
    });
    return;
  })
);

export default router;

