fix(core): update

This commit is contained in:
2022-10-29 17:16:44 +02:00
parent 62537fffe2
commit 068198a02f
4 changed files with 24 additions and 9 deletions
+19 -4
View File
@@ -1,7 +1,10 @@
import { BankAccount } from './tink.classes.bankaccount.js';
import * as plugins from './tink.plugins.js';
export interface IBankTransactiondata {
import * as tinkHelpers from './helpers/index.js';
export interface ITinkBankTransactiondata {
id: string;
accountId:string;
amount: {
currencyCode: string;
@@ -24,7 +27,6 @@ export interface IBankTransactiondata {
display: string;
original: string;
};
id: string;
identifiers: {
providerTransactionId: string;
};
@@ -87,10 +89,23 @@ export class BankTransaction {
// INSTANCE
bankAccountRef: BankAccount;
data: IBankTransactiondata;
data: ITinkBankTransactiondata;
constructor(bankAccountRefArg: BankAccount, dataArg: IBankTransactiondata) {
constructor(bankAccountRefArg: BankAccount, dataArg: ITinkBankTransactiondata) {
this.bankAccountRef = bankAccountRefArg;
this.data = dataArg;
}
/**
* gets normalized data
*/
public getNormalizedData() {
return {
id: this.data.id,
amount: tinkHelpers.getNormalizedAmount(this.data.amount),
name: this.data.descriptions.display,
description: this.data.descriptions.original
}
}
}