diff --git a/app/models/product.model.js b/app/models/product.model.js index cebbe07..39d6c7d 100644 --- a/app/models/product.model.js +++ b/app/models/product.model.js @@ -14,10 +14,20 @@ module.exports = (sequelize, DataTypes) => { type: DataTypes.INTEGER, allowNull: true, unique: true, + validate: { + len: { + args: [0, 10], + msg: "Invalid HS Code: maximum length is 10 digits." + }} }, hs_description: { type: DataTypes.TEXT, allowNull: true, + validate: { + len: { + args: [0, 1000], + msg: "HS Description is too long. Maximum allowed length is 1000 characters." + }} }, unit_id: { type: DataTypes.INTEGER,