25 lines
689 B
JavaScript
25 lines
689 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)
|
|
});
|
|
|
|
const updateStatusSchema = Joi.object({
|
|
status_number: Joi.number().integer(),
|
|
status_name: Joi.string().max(200),
|
|
status_color: Joi.string().max(200),
|
|
status_description: Joi.string().allow('', null)
|
|
}).min(1);
|
|
|
|
// ✅ Export dengan CommonJS
|
|
module.exports = {
|
|
insertStatusSchema,
|
|
updateStatusSchema
|
|
};
|