-
-
Notifications
You must be signed in to change notification settings - Fork 605
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
[Bug]: GoCardless inconsistent use of creditorName and debtorName fields #348
Comments
👋 So this basically duplicates I wonder if that might have any knock-on effect.. hmm. |
I can't see anywhere they're really used outside of setting the payee in What do you reckon to changing the logic in the Another thing we could do is the same way that dates are handled, where we check all of the various gocardless payee fields in For what it's worth I've reported the instances that I've seen it occur with GoCardless but I feel it is something that is pretty easy to patch up for better UX in actual. |
IMO it's best to have all the data sanitization logic in a single place - And yes - I agree - if there are simple ways to improve the UX on our end - we should definitely do so. :) + if (transaction.creditorName && !transaction.debtorName) {
+ transaction.debtorName = transaction.creditorName;
+ } else if (transaction.debtorName && !transaction.creditorName) {
+ transaction.creditorName = transaction.debtorName;
+ } |
Happy to put a PR in for the above, just before I do what do you think of the below proposal in the interest of keeping the sanitization logic in In a similar way that we handle the transaction date: const date =
transaction.bookingDate ||
transaction.bookingDateTime ||
transaction.valueDate ||
transaction.valueDateTime; Should we introduce new const payee =
transaction.creditorName ||
transaction.debtorName ||
transaction.remittanceInformationUnstructured ||
(transaction.remittanceInformationUnstructuredArray || []).join(', ') ||
transaction.additionalInformation; |
I think that makes sense, but would you mind cutting a PR? It will be easier to review it in-context when actually seeing the proposed change as a diff. |
Verified issue does not already exist?
What happened?
It appears that GoCardless are inconsistent across multiple banks with their use of creditor vs debtor name. Whilst I agree that it really is GoCardless' bug to fix, it seems that it effects multiple banks from my limited testing (and I've only got access to a few providers!).
This results in us falling back to unstructured information for Payee which normally includes dates and one-off transaction information.
I propose that we use the "correct" field first, and if it's not present fallback to the "incorrect".
The proposed change could either take place in
src/app-gocardless/banks/integration-bank.js
in this repository where the below could be added to thenormalizeTransaction
function. (I prefer this option)Or could be applied in the
actual
repository inpackages/loot-core/src/server/accounts/sync.ts
in thenormalizeBankSyncTransactions
function.The text was updated successfully, but these errors were encountered: