const Joi = require("joi");
const { join } = require("lodash");

const InscriptionInputType = Joi.object().keys({
  //    id: Joi.string().required(),
  code: Joi.string().optional().allow(null, ""),
  type: Joi.string().optional().allow(null, ""),
  group_size: Joi.number().optional().allow(null, ""),
});

const webInscriptionInputType = Joi.object().keys({
  //    id: Joi.string().required(),
  code: Joi.string().required(),
  email: Joi.string().email({ minDomainSegments: 2 }).required(),
  name: Joi.string().required(),
  surname: Joi.string().optional(),
  //    phone: Joi.string().optional()
});

const webv4InscriptionInputType = Joi.object().keys({
  //    id: Joi.string().required(),
  code: Joi.string().optional().allow(null, ""),
  email: Joi.string().email({ minDomainSegments: 2 }).required(),
  name: Joi.string().required(),
  surname: Joi.string().required(),
  profile: Joi.string().required(),
  country: Joi.string().required(),
  entityId: Joi.string().optional().allow(null, ""),
  group_size: Joi.number().optional().allow(null, ""),  
  //    phone: Joi.string().optional()
});

const ReservationInputType = Joi.object().keys({
  //    id: Joi.string().required(),
  reservation_code: Joi.string().required(),
  color: Joi.string().required(),
  state: Joi.string().required(),
  description: Joi.string().required(),
  init_available_date: Joi.date().optional(),
  end_available_date: Joi.date().optional(),
});

const EventQuestionInputType = Joi.object().keys({
  //eventId: Joi.string().required(),
  speakerId: Joi.string().required(),
  question: Joi.string().required(),
});

module.exports = {
  webInscriptionInputType,
  webv4InscriptionInputType,  
  InscriptionInputType,
  ReservationInputType,
  EventQuestionInputType,
};
