feat: match bank transaction

This commit is contained in:
Ahmed Bouhuolia
2024-06-20 23:31:46 +02:00
parent b37002bea6
commit 738a84bb4b
20 changed files with 492 additions and 55 deletions

View File

@@ -97,6 +97,7 @@ export default class UncategorizedCashflowTransaction extends mixin(
const {
RecognizedBankTransaction,
} = require('models/RecognizedBankTransaction');
const { MatchedBankTransaction } = require('models/MatchedBankTransaction');
return {
/**
@@ -122,6 +123,18 @@ export default class UncategorizedCashflowTransaction extends mixin(
to: 'recognized_bank_transactions.id',
},
},
/**
* Uncategorized transaction may has association to matched transaction.
*/
matchedBankTransaction: {
relation: Model.BelongsToOneRelation,
modelClass: MatchedBankTransaction,
join: {
from: 'uncategorized_cashflow_transactions.id',
to: 'matched_bank_transactions.uncategorizedTransactionId',
},
},
};
}