const Joi = require('joi');

const dirStructureModel = Joi.object({
    id: Joi.string().guid().required().messages({
        'any.required': 'ID is required',
        'string.empty': 'ID must not be empty',
        'string.guid': 'ID must be a valid GUID'
    }),
    ip: Joi.string().ip().required().messages({
        'string.ip': 'The IP address "{{#value}}" is not valid.',
        'any.required': 'IP address is required.'
    }),
    directoryStructure: Joi.string().required().messages({
        'any.required': 'Directory configuration is required',
        'string.empty': 'Directory configuration must not be empty'
    }),
    totalSize: Joi.number().required().messages({
        'any.required': 'Total space is required',
        'number.base': 'Total space must be a number'
    })
});

module.exports = dirStructureModel