feat: add bank balance column to account

This commit is contained in:
Ahmed Bouhuolia
2024-02-04 22:16:03 +02:00
parent 6d888060d3
commit 2e0b3d0d5e
8 changed files with 38 additions and 8 deletions

View File

@@ -27,7 +27,7 @@ export class PlaidApplication {
* @param {PlaidItemDTO} itemDTO
* @returns
*/
public exchangeToken(tenantId: number, itemDTO: PlaidItemDTO) {
public exchangeToken(tenantId: number, itemDTO: PlaidItemDTO): Promise<void> {
return this.plaidItemService.item(tenantId, itemDTO);
}
}

View File

@@ -1,6 +1,10 @@
import * as R from 'ramda';
import { IAccountCreateDTO, ICashflowNewCommandDTO } from '@/interfaces';
import { PlaidAccount, PlaidTransaction } from './_types';
import {
IAccountCreateDTO,
ICashflowNewCommandDTO,
PlaidAccount,
PlaidTransaction,
} from '@/interfaces';
/**
* Transformes the Plaid account to create cashflow account DTO.
@@ -18,6 +22,8 @@ export const transformPlaidAccountToCreateAccount = (
accountType: 'cash',
active: true,
plaidAccountId: plaidAccount.account_id,
bankBalance: plaidAccount.balances.current,
accountMask: plaidAccount.mask,
};
};
@@ -48,6 +54,7 @@ export const transformPlaidTrxsToCashflowCreate = R.curry(
// transactionNumber: string;
// referenceNo: string;
plaidTransactionId: plaidTranasction.transaction_id,
publish: true,
};
}