71 lines
1.1 KiB
JavaScript
71 lines
1.1 KiB
JavaScript
import { Sequelize } from 'sequelize';
|
|
|
|
const organization = {
|
|
organizationId: {
|
|
type: Sequelize.STRING,
|
|
allowNull: false,
|
|
primaryKey: true,
|
|
},
|
|
sequenceNumber: {
|
|
type: Sequelize.INTEGER,
|
|
allowNull: false,
|
|
},
|
|
companyGln: {
|
|
type: Sequelize.STRING,
|
|
},
|
|
name: {
|
|
type: Sequelize.STRING,
|
|
},
|
|
commercialName: {
|
|
type: Sequelize.STRING,
|
|
},
|
|
email: {
|
|
type: Sequelize.STRING,
|
|
},
|
|
phone: {
|
|
type: Sequelize.STRING,
|
|
},
|
|
website: {
|
|
type: Sequelize.STRING,
|
|
},
|
|
rfhRelationId: {
|
|
type: Sequelize.INTEGER,
|
|
},
|
|
paymentProviders: {
|
|
type: Sequelize.JSON,
|
|
},
|
|
endDate: {
|
|
type: Sequelize.DATE,
|
|
},
|
|
mailingAddress: {
|
|
type: Sequelize.JSON,
|
|
},
|
|
physicalAddress: {
|
|
type: Sequelize.JSON,
|
|
},
|
|
isConnected: {
|
|
type: Sequelize.BOOLEAN,
|
|
defaultValue: false,
|
|
},
|
|
lastSync: {
|
|
type: Sequelize.DATE,
|
|
allowNull: false,
|
|
defaultValue: Sequelize.NOW,
|
|
},
|
|
created: {
|
|
type: Sequelize.DATE,
|
|
allowNull: false,
|
|
defaultValue: Sequelize.NOW,
|
|
},
|
|
};
|
|
|
|
export default (sequelize) => {
|
|
return sequelize.define(
|
|
'organization',
|
|
organization, {
|
|
timestamps: false,
|
|
freezeTableName: true,
|
|
comment: 'Contains suppliers',
|
|
}
|
|
);
|
|
}; |