Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Commit

Permalink
New: Add neon bank
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisnoo committed Sep 21, 2020
1 parent f29c811 commit 00f853a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/banks.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import {BelfiusBe} from './banks/belfius-be';
import {NeonEn} from './banks/neon-en';
import {SparkasseDe} from './banks/sparkasse-de';
import {ZkbDe} from './banks/zkb-de';

export const supportedBanks = {
'belfius-be': BelfiusBe,
'sparkasse-de': SparkasseDe,
'zkb-de': ZkbDe,
'neon-en': NeonEn,
};
2 changes: 1 addition & 1 deletion src/banks/belfius-be.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class BelfiusBe extends Bank {

static transformTransactions(transactions) {
return transactions
// Remove (epmpty) transactions without a date
// Remove (empty) transactions without a date
.filter(transaction => transaction.boekingsdatum)
.map(obj => {
// Calculate amount
Expand Down
25 changes: 25 additions & 0 deletions src/banks/neon-en.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {Bank} from './base';

export class NeonEn extends Bank {
static description = 'Neon (English)';

static requiredHeaders = [
'incoming-amount-outgoing-amount', 'date', 'description',
];

static transformTransactions(transactions) {
return transactions
.filter(transaction => transaction.date)
.map(obj => {
// Calculate amount
const amount = parseFloat(obj['incoming-amount-outgoing-amount']) * 100;

return {
payee: obj.description,
date: obj.date,
amount,
};
});
}

}
2 changes: 1 addition & 1 deletion src/banks/zkb-de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class ZkbDe extends Bank {

static transformTransactions(transactions) {
return transactions
// Remove (epmpty) transactions without a date
// Remove (empty) transactions without a date
.filter(transaction => transaction.datum)
.map(obj => {
// Calculate amount
Expand Down

0 comments on commit 00f853a

Please sign in to comment.