27 lines
816 B
JavaScript
27 lines
816 B
JavaScript
const Joi = require("joi");
|
|
|
|
// ========================
|
|
// Status Validation
|
|
// ========================
|
|
const insertStatusSchema = Joi.object({
|
|
status_number: Joi.number().integer().required(),
|
|
status_name: Joi.string().max(200).required(),
|
|
status_color: Joi.string().max(200).required(),
|
|
status_description: Joi.string().allow('', null),
|
|
is_active: Joi.boolean().required(),
|
|
});
|
|
|
|
const updateStatusSchema = Joi.object({
|
|
status_number: Joi.number().integer().optional(),
|
|
status_name: Joi.string().max(200).optional(),
|
|
status_color: Joi.string().max(200).optional(),
|
|
status_description: Joi.string().allow('', null).optional(),
|
|
is_active: Joi.boolean().optional()
|
|
}).min(1);
|
|
|
|
// ✅ Export dengan CommonJS
|
|
module.exports = {
|
|
insertStatusSchema,
|
|
updateStatusSchema
|
|
};
|