const Joi = require("joi");

const LoginInputType = Joi.object().keys({
  email: Joi.string().email().required(),
  password: Joi.string().required(),
});

const LoginWithPhoneInputType = Joi.object().keys({
  phone: Joi.string().required(),
  fbuid: Joi.string().required(),
});

const LoginWithEmailInputType = Joi.object().keys({
  email: Joi.string().email().required(),
  password: Joi.string().required(),
});

const RegisterInputType = Joi.object().keys({
  phone: Joi.string().required(),
  email: Joi.string().required(),
  fbuid: Joi.string().required(),
  name: Joi.string().required(),
  surname: Joi.string(),
  entityid: Joi.string().allow(null),
  profile_picture: Joi.string().allow(null),
  profile: Joi.string().allow(null),
  country: Joi.string().allow(null),
});

const LoginOutputType = Joi.object().keys({
  token: Joi.string().required(),
});

const VerifyInputType = Joi.object().keys({
  fbuid: Joi.string().required(),
  phone: Joi.string().required(),
  email: Joi.string().required(),
});

const RequestRefreshTokenInputType = Joi.object().keys({
  token: Joi.string().required(),
  phone: Joi.string().required(),
  email: Joi.string().required(),
});

const RequestDeleteAccount = Joi.object().keys({
  id: Joi.string().required(),
  phone: Joi.string().required(),
  email: Joi.string().required(),
});

module.exports = {
  LoginWithPhoneInputType,
  LoginWithEmailInputType,
  RegisterInputType,
  LoginOutputType,
  VerifyInputType,
  RequestRefreshTokenInputType,
  RequestDeleteAccount
};
