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

martin/static-mapper #45

Merged
merged 4 commits into from
Feb 27, 2023
Merged

martin/static-mapper #45

merged 4 commits into from
Feb 27, 2023

Conversation

martinohansen
Copy link
Owner

This is a draft of my proposed way to solve the issues we've been seeing in various places including #10

An alternative solution could be to use the reflect package and allow the user complete control over the mappings. I tried to hack a bit on it but I could not get anything reasonable to work. I'd be very interested in seeing others' attempts at true dynamic mapping.

@martinohansen martinohansen added the enhancement New feature or request label Feb 24, 2023
@martinohansen martinohansen linked an issue Feb 24, 2023 that may be closed by this pull request
@martinohansen martinohansen force-pushed the martin/static-mapper branch 3 times, most recently from 1948e15 to c3d9255 Compare February 25, 2023 11:33
No bank seems to use the same Nordigen fields and the rudimentary best
effort guess on which fields to use is not gonna float for all banks.

This adds a structure for mapping every bank independently but defaults
to using or existing mapping to have no breaking changes.
@martinohansen
Copy link
Owner Author

This would still mean static mapping between different banks in source code. Just Finland alone has close to 20 bank ids let alone the rest of SEPA area. I really don't wish for such a maintenance hurdle for you.

Besides, this also means that if there ever is a user who wants something different for a hard coded bank, it would not work for him/her.

@hpernu I updated the code slightly, please check again. To your point, firstly, I don't think this will be a maintenance hurdle on just me, it's an open-source project and the maintenance is fundamentally on every user as they see fit. But one does not exclude the other, we can have static mappings for some banks but strive to keep as many banks as possible in the default mapper, for as long as it's feasible.

By the looks of it, we can simply add additionalInformatin field into the already existing search for a Payee field.

Use real NORDEA_NDEADKKK transaction from Nordigen which includes detail
in the AdditionalInformation field.
Support getting the payee from AdditionalInformation if its present in
the Nordigen transaction and no creditor/debtor nor remittance
information is available. Which is the case for SEB_KORT_AB_NO_SKHSFI21
for example.

Fixes #10
@martinohansen martinohansen force-pushed the martin/static-mapper branch 7 times, most recently from 8765e25 to 061d1f4 Compare February 26, 2023 15:25
@hpernu
Copy link
Collaborator

hpernu commented Feb 26, 2023

This would still mean static mapping between different banks in source code. Just Finland alone has close to 20 bank ids let alone the rest of SEPA area. I really don't wish for such a maintenance hurdle for you.
Besides, this also means that if there ever is a user who wants something different for a hard coded bank, it would not work for him/her.

@hpernu I updated the code slightly, please check again. To your point, firstly, I don't think this will be a maintenance hurdle on just me, it's an open-source project and the maintenance is fundamentally on every user as they see fit. But one does not exclude the other, we can have static mappings for some banks but strive to keep as many banks as possible in the default mapper, for as long as it's feasible.

By the looks of it, we can simply add additionalInformatin field into the already existing search for a Payee field.

Yes, I think so too. It would be fairly trivial to just put it as one of the options for payee source.
Although, I recommend either typing it correctly or shortening it to just something like 'info' .

When I initially implemented this feature, I'd never have guessed that additionalInformation field could have held just the actual payee. In all of my banks (five or so) it either contains the freeform message input by the payer in bank software or a collection of more verbose information (which is often too much) neither of which is useful as payee by itself.

README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
Copy link
Collaborator

@hpernu hpernu left a comment

Choose a reason for hiding this comment

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

Tried this with my banks and it just works as previously.

So the changes look okay to me but please check the changes to READMEs.

Add list of supported Nordigen banks to README and a warning log
statement for users of v1 import IDs. Remove Kubernetes as the
information was outdated and update the example config.
@martinohansen martinohansen marked this pull request as ready for review February 26, 2023 19:19
Copy link
Collaborator

@hpernu hpernu left a comment

Choose a reason for hiding this comment

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

Seems okay although some of the README stuff still might be better but then documentation can always be improved.

@martinohansen martinohansen merged commit 447dfee into main Feb 27, 2023
@martinohansen martinohansen deleted the martin/static-mapper branch February 27, 2023 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

memo field is empty
2 participants