Product create and update validation added
This commit is contained in:
parent
27acb26590
commit
3c6f0cadce
@ -14,10 +14,20 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
type: DataTypes.INTEGER,
|
type: DataTypes.INTEGER,
|
||||||
allowNull: true,
|
allowNull: true,
|
||||||
unique: true,
|
unique: true,
|
||||||
|
validate: {
|
||||||
|
len: {
|
||||||
|
args: [0, 10],
|
||||||
|
msg: "Invalid HS Code: maximum length is 10 digits."
|
||||||
|
}}
|
||||||
},
|
},
|
||||||
hs_description: {
|
hs_description: {
|
||||||
type: DataTypes.TEXT,
|
type: DataTypes.TEXT,
|
||||||
allowNull: true,
|
allowNull: true,
|
||||||
|
validate: {
|
||||||
|
len: {
|
||||||
|
args: [0, 1000],
|
||||||
|
msg: "HS Description is too long. Maximum allowed length is 1000 characters."
|
||||||
|
}}
|
||||||
},
|
},
|
||||||
unit_id: {
|
unit_id: {
|
||||||
type: DataTypes.INTEGER,
|
type: DataTypes.INTEGER,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user