const configService = require('../services/configService');
const { sendSuccess, sendError } = require('../utils/response');

/**
 * Config Controller
 * Handles configuration-related HTTP requests
 */

/**
 * Get public configurations
 * GET /api/v1/config
 */
const getPublicConfig = async (req, res) => {
  try {
    const configs = await configService.getPublicConfigs();
    return sendSuccess(res, configs, 'Configuration retrieved successfully');
  } catch (error) {
    console.error('Get public config error:', error);
    return sendError(res, error.message || 'Failed to get configuration', 500, 500);
  }
};

module.exports = {
  getPublicConfig,
};
