Skip to content

Updated FinTechGroupBank PDF Extractor to support parsing of dividend…#5502

Closed
buchen wants to merge 1 commit intoportfolio-performance:masterfrom
buchen:feature/ex-date/fintech
Closed

Updated FinTechGroupBank PDF Extractor to support parsing of dividend…#5502
buchen wants to merge 1 commit intoportfolio-performance:masterfrom
buchen:feature/ex-date/fintech

Conversation

@buchen
Copy link
Copy Markdown
Member

@buchen buchen commented Feb 21, 2026

… ex-date

Issue: #5439

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the FinTechGroupBank PDF dividend extractor to populate the new dividend ex-date field (Issue #5439), and extends the existing PDF extractor test suite to assert correct ex-date extraction across multiple dividend document variants.

Changes:

  • Add optional parsing for dividend ex-date from both Extag and Ex-Datum PDF line formats.
  • Extend FinTechGroupBank PDF extractor tests to validate exDate on extracted dividend transactions (and null where not applicable).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
name.abuchen.portfolio/src/name/abuchen/portfolio/datatransfer/pdf/FinTechGroupBankPDFExtractor.java Adds optional parsing logic to set AccountTransaction.exDate for dividend imports.
name.abuchen.portfolio.tests/src/name/abuchen/portfolio/datatransfer/pdf/fintechgroupbank/FinTechGroupBankPDFExtractorTest.java Adds assertions/matchers to verify ex-date extraction across many dividend test cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1220 to +1224
.assign((t, v) -> t.setExDate(asDate(v.get("exDate")))), //
section -> section //
.attributes("exDate") //
.match("^Ex-Datum: (?<exDate>[\\d]{1,2}\\. .* [\\d]{4}) CUSIP:.*$") //
.assign((t, v) -> t.setExDate(asDate(v.get("exDate")))))
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Ex-Datum regex is very spacing-sensitive ("Ex-Datum: " and " CUSIP:" are hard-coded) and the captured group uses a greedy .*, which can accidentally include extra whitespace. Since ExtractorUtils.asDate(...) does not trim input, any leading/trailing whitespace will cause date parsing to fail and abort extraction. Consider making the pattern whitespace-tolerant (e.g., [:\\s]+ / \\s+) and/or ensuring the captured exDate value is trimmed before calling asDate.

Suggested change
.assign((t, v) -> t.setExDate(asDate(v.get("exDate")))), //
section -> section //
.attributes("exDate") //
.match("^Ex-Datum: (?<exDate>[\\d]{1,2}\\. .* [\\d]{4}) CUSIP:.*$") //
.assign((t, v) -> t.setExDate(asDate(v.get("exDate")))))
.assign((t, v) -> t.setExDate(asDate(trim(v.get("exDate"))))), //
section -> section //
.attributes("exDate") //
.match("^Ex-Datum[:\\s]+(?<exDate>[\\d]{1,2}\\.\\s+\\p{L}+\\s+[\\d]{4})\\s+CUSIP[:\\s]*.*$") //
.assign((t, v) -> t.setExDate(asDate(trim(v.get("exDate"))))))

Copilot uses AI. Check for mistakes.
@Nirus2000
Copy link
Copy Markdown
Member

No, I don't want that.
Not until SkippedItem has been properly implemented.

@buchen
Copy link
Copy Markdown
Member Author

buchen commented Feb 22, 2026

Please let me know what you want to change.

All 9 pull request apply the parsing of the ex-date to existing banks that actually have the date in the text. That should complete the support for importing ex-date from bank documents. Each is creating a new section - or should it be wrapped into the section parsing the date? Change the order of the Junit matcher expressions?

@buchen buchen force-pushed the feature/ex-date/fintech branch from 2509a2f to 3cb038a Compare February 24, 2026 18:53
buchen added a commit to buchen/portfolio-work that referenced this pull request Feb 24, 2026
… ex-date

Issue: portfolio-performance#5439
Issue: portfolio-performance#5502

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@buchen buchen force-pushed the feature/ex-date/fintech branch from 3cb038a to 0cc3ff4 Compare February 24, 2026 18:56
… ex-date

Issue: portfolio-performance#5439
Issue: portfolio-performance#5502

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@buchen buchen force-pushed the feature/ex-date/fintech branch from 0cc3ff4 to 8c5dd97 Compare February 25, 2026 19:49
buchen added a commit that referenced this pull request Mar 15, 2026
… ex-date

Issue: #5439
Issue: #5502

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@buchen
Copy link
Copy Markdown
Member Author

buchen commented Mar 15, 2026

Merged.

The development around ex-date is independent from the development work of SkippedItems. The latter one does not stop the former one. PP is developed incrementally and continuously.

There were no comments to the change itself. For future improvements, let's open new pull requests.

@buchen buchen closed this Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants