-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Move bank sync payee name normalisation from actual
to actual-server
#2721
Conversation
actual
to actual-server
actual
to actual-server
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller
Unchanged No assets were unchanged |
actual
to actual-server
actual
to actual-server
if (trans.payeeName == null) { | ||
throw new Error('`payeeName` is required when adding a transaction'); | ||
} |
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 will break SimpleFIN support as it does not provide this field.
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.
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.
Note that SimpleFIN seems to provide payee
as a field. I am not familiar with the GoCardless side, but could it just be renamed to payee
instead of payeeName
?
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.
Maybe the issue is that the SimpleFIN server code needs to call the moved function and generate a payeeName
?
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'm not sure if we'd want to overwrite an field already provided by the APIs, so I added payeeName
to the simplefin /transactions
endpoint in the actual-server complimentary PR. Could you try running this PR with the server PR (actualbudget/actual-server#353) to confirm if this issue persists?
Happy to switch approaches if needed?
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.
So something like newTrans.payeeName = formatPayeeName(trans);
instead.
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 am not entirely sure the SimpleFIN transactions will actually change the name via that function, but at least the same code path will run as it does currently.
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.
Yes, definitely - good spot. Will get the util moved down a directory and call from both.
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.
That might also imply the function should live in another folder, instead of under the GoCardless code, since it is shared across two different bank syncs.
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.
Should be fixed in actual-server
now, util moved up a directory and run on the simplefin transacion
Since the utils for |
It's still used in another function further up actual/packages/loot-core/src/server/accounts/sync.ts Lines 205 to 213 in 08aff05
|
Ah, that is too bad. So now there is duplicated code across |
Unfortunately I can't think of a nice way out of this, apart from exporting it as part of I would welcome an alternative approach for anyone more skilled in this area |
I think we should merge this for now. We don't really have a shared library between frontend and backend and I don't think we need to create one right now. Thoughts @psybers? |
@joel-jeremy I'm totally fine with that. Was just pointing out the issue. |
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!
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, but this has to be merged at the same time as the actual-server change.
This PR makes the required changes to
actual
to move the bank sync payee normalisation intoactual-server
.Discussion issue: actualbudget/actual-server#348
actual-server
PR: actualbudget/actual-server#353