const Joi = require("joi");

const { Validate } = require("./Validate");

const ContactUsValidation = async (req, res, next) => {
  const schema = Joi.object().keys({
    name: Joi.string().required().messages({
      "any:required": "Name field is required",
    }),
    email: Joi.string().required().messages({
      "any:required": "Email field is required",
    }),
    subject: Joi.string().required().messages({
      "any:required": "Subject field is required",
    }),
    description: Joi.string().required().messages({
      "any:required": "Description field is required",
    }),
  });
  await Validate(req, res, next, schema);
};

module.exports = {
  ContactUsValidation,
};
