floriday/models/supplyLine/supplyLine.js

86 lines
1.7 KiB
JavaScript

import { Sequelize } from 'sequelize';
const supplyLine = {
supplyLineId: {
type: Sequelize.STRING,
primaryKey: true,
},
status: {
type: Sequelize.STRING,
},
pricePerPiece_currency: {
type: Sequelize.STRING,
},
pricePerPiece_value: {
type: Sequelize.DECIMAL(10,2),
},
numberOfPieces : {
type: Sequelize.INTEGER,
},
deliveryPeriod_startDateTime: {
type: Sequelize.DATE,
},
deliveryPeriod_endDateTime: {
type: Sequelize.DATE,
},
orderPeriod_startDateTime: {
type: Sequelize.DATE,
},
orderPeriod_endDateTime: {
type: Sequelize.DATE,
},
warehouseId: {
type: Sequelize.STRING,
},
sequenceNumber: {
type: Sequelize.INTEGER,
},
type: {
type: Sequelize.STRING,
},
isDeleted: {
type: Sequelize.BOOLEAN,
},
salesUnit: {
type: Sequelize.STRING,
},
agreementReference_code: {
type: Sequelize.STRING,
},
agreementReference_description: {
type: Sequelize.STRING,
},
isLimited: {
type: Sequelize.BOOLEAN,
},
isCustomerSpecific: {
type: Sequelize.BOOLEAN,
},
tradeItemId : {
type: Sequelize.STRING,
},
supplierOrganizationId : {
type: Sequelize.STRING,
},
lastSync: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.NOW,
},
created: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.NOW,
},
};
export default (sequelize) => {
const SupplyLine = sequelize.define(
'supplyLine',
supplyLine, {
timestamps: false,
freezeTableName: true,
}
);
return SupplyLine;
};