feat: licenses administration basic authentication.

feat: accounts slug.
feat: duplicate accounts_balance table and merge balance with accounts table.
feat: refactoring customers and vendors.
feat: system user soft deleting.
feat: preventing build tenant database without any subscription.
feat: remove 'password' property from 'req.user' object.
feat: refactoring JournalPoster class.
feat: delete duplicated directories and files.
This commit is contained in:
Ahmed Bouhuolia
2020-09-09 21:30:19 +02:00
parent 98bba3d3a0
commit ad00f140d1
77 changed files with 2431 additions and 1848 deletions

View File

@@ -3,6 +3,7 @@ exports.up = function (knex) {
return knex.schema.createTable('accounts', (table) => {
table.bigIncrements('id').comment('Auto-generated id');;
table.string('name');
table.string('slug');
table.integer('account_type_id').unsigned();
table.integer('parent_account_id').unsigned();
table.string('code', 10);
@@ -10,6 +11,8 @@ exports.up = function (knex) {
table.boolean('active').defaultTo(true);
table.integer('index').unsigned();
table.boolean('predefined').defaultTo(false);
table.decimal('amount', 15, 5);
table.string('currency_code', 3);
table.timestamps();
}).raw('ALTER TABLE `ACCOUNTS` AUTO_INCREMENT = 1000').then(() => {
return knex.seed.run({

View File

@@ -1,11 +0,0 @@
exports.up = function (knex) {
return knex.schema.createTable('account_balances', (table) => {
table.increments();
table.integer('account_id');
table.decimal('amount', 15, 5);
table.string('currency_code', 3);
});
};
exports.down = (knex) => knex.schema.dropTableIfExists('account_balances');

View File

@@ -13,6 +13,7 @@ exports.up = function(knex) {
table.string('note');
table.boolean('draft').defaultTo(false);
table.integer('user_id').unsigned();
table.integer('index').unsigned();
table.date('date');
table.timestamps();
}).raw('ALTER TABLE `ACCOUNTS_TRANSACTIONS` AUTO_INCREMENT = 1000');

View File

@@ -0,0 +1,49 @@
exports.up = function(knex) {
return knex.schema.createTable('contacts', table => {
table.increments();
table.string('contact_service');
table.string('contact_type');
table.decimal('balance', 13, 3).defaultTo(0);
table.decimal('opening_balance', 13, 3).defaultTo(0);
table.string('first_name').nullable();
table.string('last_name').nullable();
table.string('company_name').nullable();
table.string('display_name');
table.string('email').nullable();
table.string('work_phone').nullable();
table.string('personal_phone').nullable();
table.string('billing_address_1').nullable();
table.string('billing_address_2').nullable();
table.string('billing_address_city').nullable();
table.string('billing_address_country').nullable();
table.string('billing_address_email').nullable();
table.string('billing_address_zipcode').nullable();
table.string('billing_address_phone').nullable();
table.string('billing_address_state').nullable(),
table.string('shipping_address_1').nullable();
table.string('shipping_address_2').nullable();
table.string('shipping_address_city').nullable();
table.string('shipping_address_country').nullable();
table.string('shipping_address_email').nullable();
table.string('shipping_address_zipcode').nullable();
table.string('shipping_address_phone').nullable();
table.string('shipping_address_state').nullable();
table.text('note');
table.boolean('active').defaultTo(true);
table.timestamps();
});
};
exports.down = function(knex) {
return knex.schema.dropTableIfExists('contacts');
};