add: description in unit & value in plant sub section

This commit is contained in:
Muhammad Afif
2025-10-22 12:21:14 +07:00
parent 06582f51be
commit 519c37e82c
2 changed files with 5 additions and 1 deletions

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 = {