feat: auto recognize uncategorized transactions

This commit is contained in:
Ahmed Bouhuolia
2024-06-19 13:49:12 +02:00
parent 0b5cee070a
commit 6c4b0cdac5
9 changed files with 308 additions and 26 deletions

View File

@@ -5,11 +5,19 @@ exports.up = function (knex) {
table.string('name');
table.integer('order').unsigned();
table.integer('apply_if_account_id').unsigned();
table
.integer('apply_if_account_id')
.unsigned()
.references('id')
.inTable('accounts');
table.string('apply_if_transaction_type');
table.string('assign_category');
table.integer('assign_account_id').unsigned();
table
.integer('assign_account_id')
.unsigned()
.references('id')
.inTable('accounts');
table.string('assign_payee');
table.string('assign_memo');
@@ -19,7 +27,11 @@ exports.up = function (knex) {
})
.createTable('bank_rule_conditions', (table) => {
table.increments('id').primary();
table.integer('rule_id').unsigned();
table
.integer('rule_id')
.unsigned()
.references('id')
.inTable('bank_rules');
table.string('field');
table.string('comparator');
table.string('value');

View File

@@ -1,11 +1,23 @@
exports.up = function (knex) {
return knex.schema.createTable('recognized_bank_transactions', (table) => {
table.increments('id');
table.integer('cashflow_transaction_id').unsigned();
table.inteegr('bank_rule_id').unsigned();
table
.integer('cashflow_transaction_id')
.unsigned()
.references('id')
.inTable('uncategorized_cashflow_transactions');
table
.integer('bank_rule_id')
.unsigned()
.references('id')
.inTable('bank_rules');
table.string('assigned_category');
table.integer('assigned_account_id').unsigned();
table
.integer('assigned_account_id')
.unsigned()
.references('id')
.inTable('accounts');
table.string('assigned_payee');
table.string('assigned_memo');