-
Notifications
You must be signed in to change notification settings - Fork 639
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
PDF import for Computershare #3732
Conversation
Thank you for the pull request. Please have a look at the other importers or the example in the contributing rules. Regards |
// guessing | ||
final Pattern singleDatePattern = Pattern.compile(PATTERN_STRING_SINGLE_DATE); | ||
final Pattern doubleDatePattern = Pattern.compile(PATTERN_STRING_DOUBLE_DATE); | ||
final Pattern cusipPattern = Pattern.compile(PATTERN_STRING_CUSIP); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the thinking for extracting the pattern/attributes names into constants.
For reasons of readability, we have decided against it for most of the time.
Take the cusip pattern: the constant is defined and then used once, but now it is defined far away (in terms of lines) so that one cannot glance to see the context.
The thinking was: attributes must be consistent between match
and assign
but not beyond. So we scope it those methods.
Other than that it looks good to me (for now only looked in the browser)
t.setAmount(asAmount(v.get(PATTERN_KEY_AMOUNT))); | ||
t.setShares(asShares(v.get(PATTERN_KEY_SHARES))); | ||
final Security security = getOrCreateSecurity(v); | ||
security.setCurrencyCode(asCurrencyCode("USD")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not allowed.
The security matched by the importer might already exist in the data file of the user.
Therefore we must not change the currency (also considering that the security already has transactions and historical prices attached that assume another currency).
I will merge the importer but will change this before.
Issue: #3732 Co-authored-by: Andreas Buchen <[email protected]>
Merged. With changes. |
Pullrequest contains a pdf extractor and testcase for computershare documents .
Unfortunately CS only provides one document type and only purchase entries.
Dividends are only shown on the page but not in documents.