-
-
Notifications
You must be signed in to change notification settings - Fork 614
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
Make endDate optional when downloading GoCardless transactions #241
Make endDate optional when downloading GoCardless transactions #241
Conversation
ec59aea
to
f7bdd31
Compare
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.
LGTM, thanks for the fix 💥
For context, here are more reasoning and details
upcoming-release-notes/241.md
Outdated
authors: [kyrias] | ||
--- | ||
|
||
Stop sending `end_date` to today when downloading GoCardless transactions. |
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.
Stop sending `end_date` to today when downloading GoCardless transactions. | |
Stop sending optional `end_date` parameter to GoCardLess which is default set to `today()` when downloading transactions from GoCardless, since it filters out credit card transactions using `valueDate` for indicating when the interest-free period for the transaction ends. [Example issue for Bank on Norwegian Sweden](https://github.com/actualbudget/actual-server/pull/237#pullrequestreview-1563979522) |
Actually.. I think I know why we would want to keep this around: it allows to paginate the results. Currently we always get the latest transactions. But with the current API (start + end date) we could build pagination that fetches the full transaction history. It would just make multiple API calls to get it all. |
What if we made |
I was originally going to make it optional but decided against it to keep the changes only to the backend, but if we make it optional and start using it again in the future then aren't we going to run into the same issue again with Bank Norwegian? Though I guess we could 'just' allow you to keep paging into later months... |
This is how I'd imagine it working eventually: The latest transactions are always loaded without This isn't a comprehensive solution though. And it has many question marks (how exactly do we perform the "are there more transactions that should be fetched"?). But alas it gives a vague understanding of how it might eventually work. |
f7bdd31
to
b3c6548
Compare
Signed-off-by: Johannes Löthberg <[email protected]>
b3c6548
to
a7802a4
Compare
There simply isn't any way to do that because the API wasn't meant for that use case. If we want pagination to work properly we'd need GoCardless to actually implement a pagination feature in their API, at which point we would again not need to pass this parameter. But I've switched this to mark the argument as optional in the only place in which the type was specified. See actualbudget/actual#1493 for the other part. Would be nice to get these two merged relatively quickly so we can get the other parts ready for Bank Norwegian support. :) |
Thanks! |
There appears to be no strong reason for explicitly limiting the end date to today, and it's preventing proper integration with Bank Norwegian whose value dates actually represent when the interest-free period for the transaction ends and is therefore in the future. (#237)
After this is merged we can then remove the corresponding field from the Actual application.