2023-01-16 13:52:08 +00:00
|
|
|
import { Sequelize } from 'sequelize';
|
|
|
|
|
|
|
|
const suppliers = {
|
2023-04-03 16:11:55 +00:00
|
|
|
sequenceNumber: {
|
|
|
|
type: Sequelize.INTEGER,
|
|
|
|
allowNull: false,
|
2023-05-03 17:46:40 +00:00
|
|
|
primaryKey: true,
|
|
|
|
},
|
|
|
|
organizationId: {
|
|
|
|
type: Sequelize.STRING,
|
|
|
|
allowNull: false,
|
|
|
|
primaryKey: true,
|
2023-04-03 16:11:55 +00:00
|
|
|
},
|
|
|
|
companyGln: {
|
|
|
|
type: Sequelize.STRING,
|
|
|
|
},
|
|
|
|
name: {
|
|
|
|
type: Sequelize.STRING,
|
2023-02-03 12:56:34 +00:00
|
|
|
},
|
|
|
|
commercialName: {
|
|
|
|
type: Sequelize.STRING,
|
|
|
|
},
|
|
|
|
email: {
|
|
|
|
type: Sequelize.STRING,
|
|
|
|
},
|
|
|
|
phone: {
|
|
|
|
type: Sequelize.STRING,
|
|
|
|
},
|
|
|
|
website: {
|
|
|
|
type: Sequelize.STRING,
|
|
|
|
},
|
2023-04-03 16:11:55 +00:00
|
|
|
rfhRelationId: {
|
|
|
|
type: Sequelize.INTEGER,
|
2023-02-03 12:56:34 +00:00
|
|
|
},
|
2023-04-03 16:11:55 +00:00
|
|
|
paymentProviders: {
|
2023-02-03 12:56:34 +00:00
|
|
|
type: Sequelize.STRING,
|
|
|
|
},
|
|
|
|
endDate: {
|
|
|
|
type: Sequelize.DATE,
|
|
|
|
},
|
2023-04-03 16:11:55 +00:00
|
|
|
mailingAddress: {
|
|
|
|
type: Sequelize.JSON,
|
2023-02-03 12:56:34 +00:00
|
|
|
},
|
2023-04-03 16:11:55 +00:00
|
|
|
physicalAddress: {
|
|
|
|
type: Sequelize.JSON,
|
|
|
|
},
|
|
|
|
isConnected: {
|
|
|
|
type: Sequelize.BOOLEAN,
|
|
|
|
defaultValue: false,
|
|
|
|
},
|
2023-01-16 13:52:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default (sequelize) => {
|
2023-05-03 17:46:40 +00:00
|
|
|
const Suppliers = sequelize.define('suppliers', suppliers, {
|
2023-01-16 13:52:08 +00:00
|
|
|
timestamps: false,
|
|
|
|
freezeTableName: true,
|
|
|
|
});
|
|
|
|
return Suppliers;
|
|
|
|
};
|