Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Mark transactions as imported in YNAB #121

Merged
merged 2 commits into from Jun 14, 2021
Merged

Mark transactions as imported in YNAB #121

merged 2 commits into from Jun 14, 2021

Conversation

mKeRix
Copy link
Contributor

@mKeRix mKeRix commented Jun 13, 2021

This allows for transaction matching and makes the tool work like the official direct and file import features from YNAB. The format matches the official one, as it is described in their API docs. In the end it will look like this in the YNAB UI:

Bildschirmfoto 2021-06-13 um 18 23 23

Unmatched transactions will be added like before, items that already have a matching transaction will be linked to the existing one. If YNAB ever officially starts supporting direct import from ING there should be no duplicates either, as we adhere to their ID format.

In theory this would also allow the tool to drop the state file - transactions with the same import id won't be added again, I tested this by re-running the tool after deleting the state file. If you want I can remove this logic, but I wanted to start with a minimal change and hear feedback from you.

I also switched the datetime usage to date, as I noticed that the returned values from the FinTS lib are Date objects, not Datetime ones.

Closes #117.

@bahlo
Copy link
Owner

bahlo commented Jun 13, 2021

Hey Heiko, thank you so much for this PR, it looks great! 🙌

Sadly I can't test this right now because the YNAB API is having some issues with importing transactions (see YNAB Status), but I will try it out tomorrow.

It also seems like something is broken with the pipeline for PRs from forked repositories, going to check that out as well (though that's not a blocker to merge this).

Regarding the state file: I'd love to get rid of it, I think the best strategy would be to merge this, do a release and drop the state file in the next release. Otherwise people might get duplicate imports (one with the import_id and one without).

This allows for transaction matching and makes the tool work like
the official direct and file import features from YNAB.
@bahlo bahlo enabled auto-merge June 14, 2021 06:44
@bahlo
Copy link
Owner

bahlo commented Jun 14, 2021

Tested it and it works great! Fixed the linter issues for you, will cut a release once this is merged. Thanks again 🙏

@bahlo bahlo merged commit 1789005 into bahlo:main Jun 14, 2021
This was referenced Jun 14, 2021
@mKeRix mKeRix deleted the import-ids branch June 20, 2021 08:06
@mKeRix
Copy link
Contributor Author

mKeRix commented Jun 20, 2021

Awesome, thanks for the linter fixes & speedy release! I will try to submit a PR for removing the state file when I find some more time to work on this. The project is already a huge help for me as is now though. :)

@bahlo bahlo mentioned this pull request Aug 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mark added transactions as "imported"
2 participants