Merge pull request 'wisdom' (#4) from wisdom into main

Reviewed-on: #4
This commit is contained in:
2025-10-23 04:51:40 +00:00
2 changed files with 9 additions and 9 deletions

View File

@@ -8,13 +8,13 @@ const insertTagsSchema = Joi.object({
device_id: Joi.number().optional(), device_id: Joi.number().optional(),
tag_name: Joi.string().max(200).required(), tag_name: Joi.string().max(200).required(),
tag_number: Joi.number().required(), tag_number: Joi.number().required(),
is_active: Joi.boolean().required(), is_active: Joi.boolean().optional(),
data_type: Joi.string().max(50).required(), data_type: Joi.string().max(50).optional(),
unit: Joi.string().max(50).required(), unit: Joi.string().max(50).optional(),
sub_section_id: Joi.number().optional(), sub_section_id: Joi.number().optional(),
is_alarm: Joi.boolean().required(), is_alarm: Joi.boolean().optional(),
is_report: Joi.boolean().required(), is_report: Joi.boolean().optional(),
is_history: Joi.boolean().required(), is_history: Joi.boolean().optional(),
lim_low_crash: Joi.number().optional(), lim_low_crash: Joi.number().optional(),
lim_low: Joi.number().optional(), lim_low: Joi.number().optional(),
lim_high: Joi.number().optional(), lim_high: Joi.number().optional(),
@@ -22,7 +22,7 @@ const insertTagsSchema = Joi.object({
}); });
const updateTagsSchema = Joi.object({ const updateTagsSchema = Joi.object({
device_id: Joi.number(), device_id: Joi.number().required(),
tag_name: Joi.string().max(200), tag_name: Joi.string().max(200),
tag_number: Joi.number(), tag_number: Joi.number(),
is_active: Joi.boolean(), is_active: Joi.boolean(),

View File

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