wisdom #3

Merged
bragaz_rexita merged 6 commits from wisdom into main 2025-10-22 05:27:57 +00:00
2 changed files with 5 additions and 1 deletions
Showing only changes of commit 519c37e82c - Show all commits

View File

@@ -13,6 +13,7 @@ const insertSubSectionSchema = Joi.object({
"any.required": "Sub section name is required"
}).required(),
is_active: Joi.boolean().required(),
value: Joi.string().max(100).optional()
});
const updateSubSectionSchema = Joi.object({
@@ -23,6 +24,7 @@ const updateSubSectionSchema = Joi.object({
"string.max": "Sub section name cannot exceed 200 characters",
}).optional(),
is_active: Joi.boolean().optional(),
value: Joi.string().max(100).optional()
}).min(1).messages({
"object.min": "At least one field must be provided to update",
});

View File

@@ -7,12 +7,14 @@ const insertUnitSchema = Joi.object({
unit_name: Joi.string().max(100).required(),
tag_id: Joi.number().integer().optional(),
is_active: Joi.boolean().required(),
description: Joi. string().max(100).optional()
});
const updateUnitSchema = Joi.object({
unit_name: Joi.string().max(100).optional(),
tag_id: Joi.number().integer().optional(),
is_active: Joi.boolean().optional()
is_active: Joi.boolean().optional(),
description: Joi. string().max(100).optional()
}).min(1);
module.exports = {