2023-01-16 13:52:08 +00:00
|
|
|
import { Sequelize } from 'sequelize';
|
|
|
|
|
2023-05-30 09:46:46 +00:00
|
|
|
const organization = {
|
2023-05-17 08:24:10 +00:00
|
|
|
organizationId: {
|
2023-05-15 12:19:43 +00:00
|
|
|
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,
|
|
|
|
},
|
2023-01-16 13:52:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default (sequelize) => {
|
2023-05-30 09:46:46 +00:00
|
|
|
return sequelize.define(
|
2023-05-17 08:24:10 +00:00
|
|
|
'organization',
|
2023-05-30 09:46:46 +00:00
|
|
|
organization, {
|
2023-05-15 12:19:43 +00:00
|
|
|
timestamps: false,
|
|
|
|
freezeTableName: true,
|
|
|
|
}
|
|
|
|
);
|
2023-01-16 13:52:08 +00:00
|
|
|
};
|