const Joi = require('joi');

const usersModifyModel = Joi.object({
    name: Joi.string().required().messages({
        'any.required': 'User name is required',
        'string.empty': 'User name must not be empty'
    }),
    email: Joi.string().email().required().messages({
        'any.required': 'User email is required',
        'string.empty': 'User email must not be empty',
        'string.email': 'User email must be a valid email address'
    }),
    password: Joi.string().min(8).max(20).required().messages({
        'any.required': 'Password is required',
        'string.empty': 'Password must not be empty',
        'string.min': 'Password must be at least {#limit} characters long',
        'string.max': 'Password must be at most {#limit} characters long'
    })
});

module.exports = usersModifyModel;