API CEO + USER v1.0
This commit is contained in:
@@ -7,6 +7,7 @@ const ceoModifyModelSchema = require('./ceoModifyModel');
|
||||
const emailVerificationSchema = require('./emailVerificationModel');
|
||||
const userDepartmentPatchSchema = require('./userDepartmentPatchModel');
|
||||
const ceoPasswordModelSchema = require('./ceoPasswordModel');
|
||||
const securityLevelsModelSchema = require('./securityLevelsModel');
|
||||
|
||||
module.exports = {
|
||||
schemas: {
|
||||
@@ -18,6 +19,7 @@ module.exports = {
|
||||
ceoModifyModelSchema,
|
||||
emailVerificationSchema,
|
||||
userDepartmentPatchSchema,
|
||||
ceoPasswordModelSchema
|
||||
ceoPasswordModelSchema,
|
||||
securityLevelsModelSchema
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user