feat: enhance sparepart database queries and sparepart number validation

This commit is contained in:
2026-04-27 17:22:21 +07:00
parent b7fa4b3d07
commit 51f4ea2bff
4 changed files with 20 additions and 16 deletions

View File

@@ -17,8 +17,8 @@ const insertDeviceSchema = Joi.object({
'string.ip': 'IP address must be a valid IPv4 or IPv6 address'
}),
listen_channel: Joi.string().max(100).required(),
listen_channel_reminder: Joi.string().max(100).optional(),
reminder_at: Joi.date().iso().allow(null).optional()
listen_channel_reminder: Joi.string().max(100).allow('', null),
reminder_at: Joi.date().iso().allow('', null),
});
const updateDeviceSchema = Joi.object({
@@ -33,8 +33,8 @@ const updateDeviceSchema = Joi.object({
'string.ip': 'IP address must be a valid IPv4 or IPv6 address'
}),
listen_channel: Joi.string().max(100),
listen_channel_reminder: Joi.string().max(100).optional(),
reminder_at: Joi.date().iso().allow(null).optional()
listen_channel_reminder: Joi.string().max(100).allow('', null),
reminder_at: Joi.date().iso().allow('', null),
}).min(1);