floriday/models/organization/organization.js

71 lines
1.1 KiB
JavaScript
Raw Normal View History

2023-01-16 13:52:08 +00:00
import { Sequelize } from 'sequelize';
const organizations = {
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) => {
const Organizations = sequelize.define(
'organization',
organizations, {
2023-05-15 12:19:43 +00:00
timestamps: false,
freezeTableName: true,
}
);
return Organizations;
2023-01-16 13:52:08 +00:00
};