const Joi = require("joi");

// Define a schema for the string values (department names)
const nameSchema = Joi.string().required().messages({
    'string.empty': 'Name can\'t be empty',
    'any.required': 'Name is required'
});

// Define the main schema for the security levels model
const securityLevelsModel = Joi.object().pattern(
    Joi.number().integer().positive().messages({
        'number.base': 'Keys must be integers',
        'number.integer': 'Keys must be integers',
        'number.positive': 'Keys must be positive integers'
    }),
    nameSchema
);

module.exports = securityLevelsModel;
