const sequelize = require('../config/db.js');
const Bank = require('./bank.js');
const BankBranch = require('./bank_branch.js');
const BankAccount = require('./bank_account.js');
const Billable = require('./billable.js');
const Entity = require('./entity.js');
const PEntity = require('./p_entity.js');
const InvoiceTemplate = require('./invoice_template.js');
const Tax = require('./tax.js');
const User = require('./user.js');
const Group = require('./group.js');
const Module = require('./module.js');
const Invoice = require('./invoice.js');
const ChangeLog = require('./change_logs.js');
const EntityHeader = require('./entity_header.js');

const models = { Bank, BankBranch, BankAccount, Billable, Entity, PEntity, InvoiceTemplate, Tax, User, Group, Module, Invoice, ChangeLog, EntityHeader };

Object.keys(models).forEach((model) => {
    if(models[model].associate) {
        models[model].associate(models);
    }
})

module.exports = models