/**
 * @description Log validation error and send response
 * @param res
 * @param logger
 * @param logCode
 * @param message
 * @param logMeta
 * @param returnCode
 * @returns {*}
 */
const handlePaymentValidationError = (res, logger, logCode, message, logMeta, returnCode) => {
  logger.log(logCode, "ERROR", "api", null, {
    message,
    ...logMeta
  });
  return res.status(returnCode || 400).send(`Bad Request: ${message}`);
};

module.exports = handlePaymentValidationError;
