6
6
7
7
/** @type {import('./bank.interface.js').IBank } */
8
8
export default {
9
- institutionIds : [ 'SEB_KORT_AB_SE_SKHSFI21' ] ,
9
+ institutionIds : [ 'SEB_KORT_AB_NO_SKHSFI21' , ' SEB_KORT_AB_SE_SKHSFI21'] ,
10
10
11
11
accessValidForDays : 180 ,
12
12
@@ -44,11 +44,11 @@ export default {
44
44
} ,
45
45
46
46
/**
47
- * For SEB_KORT_AB_SE_SKHSFI21 we don't know what balance was
47
+ * For SEB_KORT_AB_NO_SKHSFI21 and SEB_KORT_AB_SE_SKHSFI21 we don't know what balance was
48
48
* after each transaction so we have to calculate it by getting
49
49
* current balance from the account and subtract all the transactions
50
50
*
51
- * As a current balance we use `expected` balance type because it
51
+ * As a current balance we use `expected` and `nonInvoiced` balance types because it
52
52
* corresponds to the current running balance, whereas `interimAvailable`
53
53
* holds the remaining credit limit.
54
54
*/
@@ -57,8 +57,12 @@ export default {
57
57
( balance ) => 'expected' === balance . balanceType ,
58
58
) ;
59
59
60
+ const nonInvoiced = balances . find (
61
+ ( balance ) => 'nonInvoiced' === balance . balanceType ,
62
+ ) ;
63
+
60
64
return sortedTransactions . reduce ( ( total , trans ) => {
61
65
return total - amountToInteger ( trans . transactionAmount . amount ) ;
62
- } , - amountToInteger ( currentBalance . balanceAmount . amount ) ) ;
66
+ } , - amountToInteger ( currentBalance . balanceAmount . amount ) + amountToInteger ( nonInvoiced . balanceAmount . amount ) ) ;
63
67
} ,
64
68
} ;
0 commit comments