feat: bank rules for uncategorized transactions

This commit is contained in:
Ahmed Bouhuolia
2024-06-18 17:14:30 +02:00
parent 590715037b
commit 906835c396
16 changed files with 752 additions and 2 deletions

View File

@@ -0,0 +1,33 @@
exports.up = function (knex) {
return knex.schema
.createTable('bank_rules', (table) => {
table.increments('id').primary();
table.string('name');
table.integer('order').unsigned();
table.integer('apply_if_account_id').unsigned();
table.string('apply_if_transaction_type');
table.string('assign_category');
table.integer('assign_account_id').unsigned();
table.string('assign_payee');
table.string('assign_memo');
table.string('conditions_type');
table.timestamps();
})
.createTable('bank_rule_conditions', (table) => {
table.increments('id').primary();
table.integer('rule_id').unsigned();
table.string('field');
table.string('comparator');
table.string('value');
});
};
exports.down = function (knex) {
return knex.schema
.dropTableIfExists('bank_rules')
.dropTableIfExists('bank_rule_conditions');
};