feat(server): sync Plaid transactions to uncategorized transactions

This commit is contained in:
Ahmed Bouhuolia
2024-03-04 13:42:17 +02:00
parent 9db03350e0
commit f23e8d98f6
10 changed files with 113 additions and 24 deletions

View File

@@ -13,13 +13,15 @@ export class GetUncategorizedTransactions {
/**
* Retrieves the uncategorized cashflow transactions.
* @param {number} tenantId
* @param {number} tenantId - Tenant id.
* @param {number} accountId - Account Id.
*/
public async getTransactions(tenantId: number) {
public async getTransactions(tenantId: number, accountId: number) {
const { UncategorizedCashflowTransaction } = this.tenancy.models(tenantId);
const { results, pagination } =
await UncategorizedCashflowTransaction.query()
.where('accountId', accountId)
.where('categorized', false)
.withGraphFetched('account')
.pagination(0, 10);