Skip to content

Commit

Permalink
Improve FlatEx PDF-Importer
Browse files Browse the repository at this point in the history
Format source to standard eclipse format
Improve regulare expressions
Remove obsolet source
  • Loading branch information
Nirus2000 committed May 17, 2024
1 parent 49713ef commit 8db9223
Show file tree
Hide file tree
Showing 3 changed files with 3,078 additions and 3,100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3123,70 +3123,23 @@ public void testFinTechKontoauszug06()

// assert transaction
assertThat(results, hasItem(deposit(hasDate("2018-12-06"), hasAmount("EUR", 12.00), //
hasSource("FinTechKontoauszug06.txt"),
hasNote("Prämie Morgan Stanley-Aktion"))));
hasSource("FinTechKontoauszug06.txt"), hasNote("Prämie"))));

// assert transaction
assertThat(results, hasItem(deposit(hasDate("2018-12-07"), hasAmount("EUR", 6.00), //
hasSource("FinTechKontoauszug06.txt"),
hasNote("Prämie Morgan Stanley-Aktion"))));
hasSource("FinTechKontoauszug06.txt"), hasNote("Prämie"))));

// assert transaction
assertThat(results, hasItem(deposit(hasDate("2018-12-10"), hasAmount("EUR", 2.00), //
hasSource("FinTechKontoauszug06.txt"),
hasNote("Prämie Morgan Stanley-Aktion"))));
hasSource("FinTechKontoauszug06.txt"), hasNote("Prämie"))));

// assert transaction
assertThat(results, hasItem(deposit(hasDate("2018-12-11"), hasAmount("EUR", 8.00), //
hasSource("FinTechKontoauszug06.txt"),
hasNote("Prämie Morgan Stanley-Aktion"))));
hasSource("FinTechKontoauszug06.txt"), hasNote("Prämie"))));

// assert transaction
assertThat(results, hasItem(deposit(hasDate("2018-12-12"), hasAmount("EUR", 6.00), //
hasSource("FinTechKontoauszug06.txt"),
hasNote("Prämie Morgan Stanley-Aktion"))));
}

@Test
public void testFinTechKontoauszug07()
{
FinTechGroupBankPDFExtractor extractor = new FinTechGroupBankPDFExtractor(new Client());

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

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

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

// assert transaction
assertThat(results, hasItem(interestCharge(hasDate("2019-06-30"), hasAmount("EUR", 0.50), //
hasSource("FinTechKontoauszug07.txt"), hasNote("Zinsabschluss 01.04.2019 - 30.06.2019"))));

// assert transaction
assertThat(results, hasItem(removal(hasDate("2019-07-02"), hasAmount("EUR", 495.05), //
hasSource("FinTechKontoauszug07.txt"), hasNote("Überweisung"))));

// assert transaction
assertThat(results, hasItem(interest(hasDate("2019-08-01"), hasAmount("EUR", 0.11), //
hasSource("FinTechKontoauszug07.txt"), hasNote("ZINSPILOT Auszahlung FIMBank p.l.c."))));

// assert transaction
assertThat(results, hasItem(interest(hasDate("2019-08-16"), hasAmount("EUR", 0.09), //
hasSource("FinTechKontoauszug07.txt"), hasNote("ZINSPILOT Auszahlung FIMBank p.l.c."))));

// assert transaction
assertThat(results, hasItem(interest(hasDate("2019-09-02"), hasAmount("EUR", 0.11), //
hasSource("FinTechKontoauszug07.txt"), hasNote("ZINSPILOT Auszahlung FIMBank p.l.c."))));

// assert transaction
assertThat(results, hasItem(interest(hasDate("2019-09-16"), hasAmount("EUR", 0.09), //
hasSource("FinTechKontoauszug07.txt"), hasNote("ZINSPILOT Auszahlung FIMBank p.l.c."))));
hasSource("FinTechKontoauszug06.txt"), hasNote("Prämie"))));
}

@Test
Expand Down Expand Up @@ -5707,6 +5660,48 @@ public void testFlatExKontoauszug03()
assertThat(transaction.getNote(), is("Zinsabschluss 01.04.2020 - 30.06.2020"));
}

@Test
public void testFlatExKontoauszug04()
{
FinTechGroupBankPDFExtractor extractor = new FinTechGroupBankPDFExtractor(new Client());

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

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

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

// assert transaction
assertThat(results, hasItem(interestCharge(hasDate("2019-06-30"), hasAmount("EUR", 0.50), //
hasSource("FlatExKontoauszug04.txt"), hasNote("Zinsabschluss 01.04.2019 - 30.06.2019"))));

// assert transaction
assertThat(results, hasItem(removal(hasDate("2019-07-02"), hasAmount("EUR", 495.05), //
hasSource("FlatExKontoauszug04.txt"), hasNote("Überweisung"))));

// assert transaction
assertThat(results, hasItem(interest(hasDate("2019-08-01"), hasAmount("EUR", 0.11), //
hasSource("FlatExKontoauszug04.txt"), hasNote("ZINSPILOT Auszahlung FIMBank p.l.c."))));

// assert transaction
assertThat(results, hasItem(interest(hasDate("2019-08-16"), hasAmount("EUR", 0.09), //
hasSource("FlatExKontoauszug04.txt"), hasNote("ZINSPILOT Auszahlung FIMBank p.l.c."))));

// assert transaction
assertThat(results, hasItem(interest(hasDate("2019-09-02"), hasAmount("EUR", 0.11), //
hasSource("FlatExKontoauszug04.txt"), hasNote("ZINSPILOT Auszahlung FIMBank p.l.c."))));

// assert transaction
assertThat(results, hasItem(interest(hasDate("2019-09-16"), hasAmount("EUR", 0.09), //
hasSource("FlatExKontoauszug04.txt"), hasNote("ZINSPILOT Auszahlung FIMBank p.l.c."))));
}

@Test
public void testFlatExDegiroKontoauszug01()
{
Expand Down
Loading

0 comments on commit 8db9223

Please sign in to comment.