Skip to content

Commit

Permalink
Modify Bondora PDF-Importer to support new transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Nirus2000 authored and buchen committed Dec 23, 2023
1 parent a03cdbb commit 8bad0b8
Show file tree
Hide file tree
Showing 3 changed files with 189 additions and 131 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
package name.abuchen.portfolio.datatransfer.pdf.bondoracapital;

import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.deposit;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasAmount;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasDate;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasNote;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasSource;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.interest;
import static name.abuchen.portfolio.datatransfer.ExtractorTestUtilities.countAccountTransactions;
import static name.abuchen.portfolio.datatransfer.ExtractorTestUtilities.countBuySell;
import static name.abuchen.portfolio.datatransfer.ExtractorTestUtilities.countSecurities;
import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.collection.IsEmptyCollection.empty;
Expand Down Expand Up @@ -792,4 +802,30 @@ public void testKontoauszug13()
assertThat(transaction.getSource(), is("Kontoauszug13.txt"));
assertThat(transaction.getNote(), is("Go & Grow returns"));
}

@Test
public void testKontoauszug14()
{
BondoraCapitalPDFExtractor extractor = new BondoraCapitalPDFExtractor(new Client());

List<Exception> errors = new ArrayList<>();

List<Item> results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "Kontoauszug14.txt"),
errors);

assertThat(errors, empty());
assertThat(countSecurities(results), is(0L));
assertThat(countBuySell(results), is(0L));
assertThat(countAccountTransactions(results), is(2L));
assertThat(results.size(), is(2));
new AssertImportActions().check(results, CurrencyUnit.EUR);

// assert transaction
assertThat(results, hasItem(deposit(hasDate("2023-11-27"), hasAmount("EUR", 50.00), //
hasSource("Kontoauszug14.txt"), hasNote("SEPA-Banküberweisung"))));

// assert transaction
assertThat(results, hasItem(interest(hasDate("2023-11-28"), hasAmount("EUR", 0.19), //
hasSource("Kontoauszug14.txt"), hasNote("Go & Grow Zinsen"))));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
PDFBox Version: 1.8.17
Portfolio Performance Version: 0.65.6
-----------------------------------------
Zusammenfassung
Zu Beginn 1.009,3 €
QAPWSp ocTcYi
Einzahlungen 55,49 €
Datum 01.11.2023 - 30.11.2023 Auszahlungen 0 €
Referenznummer TJ3309181 Ergebnis 1.064,79 €
Go & Grow
Datum Zahlungsart Eingänge Ausgänge Guthaben
27.11.2023 SEPA-Banküberweisung 50 € 1.064,4 €
Bis zu 4 %* Rendite p. a. 0 €
Bis zu 6,75 %* Rendite p. a. 50 € 1.064,4 €
28.11.2023 Go & Grow Zinsen 0,19 € 1.064,41 €
Gesamt 1.064,79 €
Loading

0 comments on commit 8bad0b8

Please sign in to comment.