exports.successResponse = (res, data, message = 'Success') => {
    return res.status(200).json({
        success: true,
        message,
        data: Array.isArray(data) ? data : { ...data }
    });
};

exports.errorResponse = (res, error) => {
    const statusCode = error.statusCode || 500;
    const message = error.message || 'Internal server error';
    return res.status(statusCode).json({
        success: false,
        message
    });
};

exports.messageSuccessResponse = (res, message = 'Success', status_code = 200) => {
    return res.status(status_code).json({
        success: true,
        message,
    });
};