Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify Bondora PDF-Importer to support new transaction #3683

Merged
merged 1 commit into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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