const Joi = require('joi');

const usersRegisterModel = 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': 'Email is required',
        'string.empty': 'Email must not be empty',
        'string.email': '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'
    }),
    department: Joi.string().required().messages({
        'any.required': 'Department ID is required',
        'string.empty': 'Department ID must not be empty'
    })
});

module.exports = usersRegisterModel;