Compare commits

..

6 Commits

Author SHA1 Message Date
ab1ac03993 3.1.6 2022-10-30 17:27:13 +01:00
3ee4a1677e fix(core): update 2022-10-30 17:27:13 +01:00
29bd68f57d 3.1.5 2022-10-30 15:22:13 +01:00
5227cebc98 fix(core): update 2022-10-30 15:22:13 +01:00
4301a0337c 3.1.4 2022-10-29 19:15:30 +02:00
723833d9bb fix(core): use correct pow 2022-10-29 19:15:30 +02:00
5 changed files with 7 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@mojoio/tink",
"version": "3.1.3",
"version": "3.1.6",
"private": false,
"description": "an unofficial api abstraction for tink.com",
"main": "dist_ts/index.js",

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@mojoio/tink',
version: '3.1.3',
version: '3.1.6',
description: 'an unofficial api abstraction for tink.com'
}

View File

@ -16,7 +16,7 @@ export const getNormalizedAmount = (scaledArg?: ITinkScaledAmount) => {
return null;
}
return {
amount: parseInt(scaledArg.value.unscaledValue) * Math.pow(10, -(parseInt(scaledArg.value.scale))),
value: parseInt(scaledArg.value.unscaledValue) * Math.pow(10, -(parseInt(scaledArg.value.scale))),
currency: 'EUR'
};
};

View File

@ -111,10 +111,8 @@ export class BankAccount {
return {
id: this.data.id,
name: this.data.name,
accountNumber:
this.data.identifiers.iban?.iban ||
this.data.identifiers?.financialInstitution?.accountNumber ||
null,
accountNumber: this.data.identifiers?.financialInstitution?.accountNumber || null,
iban: this.data.identifiers.iban?.iban || null,
bookedValue: tinkHelpers.getNormalizedAmount(this.data.balances.booked?.amount),
availableValue: tinkHelpers.getNormalizedAmount(this.data.balances.available?.amount),
};

View File

@ -102,9 +102,11 @@ export class BankTransaction {
public getNormalizedData() {
return {
id: this.data.id,
date: new Date(this.data.dates.booked).getTime(),
amount: tinkHelpers.getNormalizedAmount(this.data.amount),
name: this.data.descriptions.display,
description: this.data.descriptions.original,
originAccountId: this.data.accountId,
justForLooks: {
originalScaledAmount: this.data.amount
}