Product create and update validation added

This commit is contained in:
unknown 2025-12-09 16:52:50 +05:30
parent 27acb26590
commit 3c6f0cadce

View File

@ -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,