2023-01-09 10:59:07 +00:00
|
|
|
import { Sequelize } from 'sequelize';
|
2022-12-05 12:53:30 +00:00
|
|
|
|
|
|
|
const tradeItem = {
|
|
|
|
tradeItemId: {
|
2023-01-11 12:13:22 +00:00
|
|
|
type: Sequelize.STRING,
|
2023-02-08 11:31:54 +00:00
|
|
|
primaryKey: true,
|
2022-12-05 12:53:30 +00:00
|
|
|
},
|
|
|
|
code: {
|
|
|
|
type: Sequelize.STRING
|
|
|
|
},
|
|
|
|
gtin: {
|
|
|
|
type: Sequelize.STRING
|
|
|
|
},
|
|
|
|
vbnProductCode: {
|
|
|
|
type: Sequelize.STRING
|
|
|
|
},
|
|
|
|
name: {
|
|
|
|
type: Sequelize.STRING
|
|
|
|
},
|
|
|
|
isDeleted: {
|
|
|
|
type: Sequelize.BOOLEAN,
|
|
|
|
},
|
|
|
|
sequenceNumber: {
|
|
|
|
type: Sequelize.INTEGER,
|
|
|
|
},
|
|
|
|
tradeItemVersion: {
|
|
|
|
type: Sequelize.INTEGER,
|
|
|
|
},
|
|
|
|
isCustomerSpecific: {
|
|
|
|
type: Sequelize.BOOLEAN,
|
|
|
|
},
|
|
|
|
isHiddenInCatalog: {
|
|
|
|
type: Sequelize.BOOLEAN,
|
2023-05-15 12:19:43 +00:00
|
|
|
},
|
2023-05-17 08:24:10 +00:00
|
|
|
organizationId: {
|
2023-05-15 12:19:43 +00:00
|
|
|
type: Sequelize.STRING
|
|
|
|
},
|
|
|
|
lastSync: {
|
|
|
|
type: Sequelize.DATE,
|
|
|
|
allowNull: false,
|
|
|
|
defaultValue: Sequelize.NOW,
|
|
|
|
},
|
|
|
|
created: {
|
|
|
|
type: Sequelize.DATE,
|
|
|
|
allowNull: false,
|
|
|
|
defaultValue: Sequelize.NOW,
|
|
|
|
},
|
2022-12-05 12:53:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default (sequelize) => {
|
2023-05-30 09:46:46 +00:00
|
|
|
return sequelize.define(
|
|
|
|
'tradeItem',
|
|
|
|
tradeItem,
|
|
|
|
{
|
|
|
|
timestamps: false,
|
|
|
|
freezeTableName: true,
|
|
|
|
}
|
|
|
|
);
|
2022-12-05 12:53:30 +00:00
|
|
|
};
|