-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
enhancement: fix Cetelem bank transations #5914
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
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
7e39d0f
to
cb5c1aa
Compare
The amount coming from GoCardless has the opposite sign of what we expect.
cb5c1aa
to
2c554a5
Compare
WalkthroughAdds a new bank integration module at packages/sync-server/src/app-gocardless/banks/cetelem_cetmptp1xxx.js. The module spreads the existing Fallback bank, registers institutionIds with ['CETELEM_CETMPTP1XXX'], and overrides normalizeTransaction to create a shallow copy editedTrans, negate transaction.transactionAmount.amount (numeric negation, converted to string, currency preserved), then calls and returns Fallback.normalizeTransaction with editedTrans as the referenced transaction. Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
upcoming-release-notes/5914.md
is excluded by!**/*.md
📒 Files selected for processing (1)
packages/sync-server/src/app-gocardless/banks/cetelem_cetmptp1xxx.js
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)
Use TypeScript for all code
Files:
packages/sync-server/src/app-gocardless/banks/cetelem_cetmptp1xxx.js
🔇 Additional comments (1)
packages/sync-server/src/app-gocardless/banks/cetelem_cetmptp1xxx.js (1)
12-22
: No changes needed—sign flip and mutation follow existing patterns UsingparseFloat
for a simple unary negation of fixed two-decimal strings won’t incur rounding issues here, and in-place mutation oftransaction
is how all other bank integrations implementnormalizeTransaction
.Likely an incorrect or invalid review comment.
WalkthroughAdds a new GoCardless bank adapter module for Cetelem (CETELEM_CETMPTP1XXX). The adapter extends the existing Fallback implementation, sets institutionIds to ["CETELEM_CETMPTP1XXX"], and overrides normalizeTransaction. In normalizeTransaction, it creates a shallow copy of the input transaction, flips the sign of transaction.transactionAmount.amount (preserving currency), and delegates normalization to Fallback.normalizeTransaction(transaction, booked, editedTrans). The module exports the composed IBank-implementing object as the default export. Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
upcoming-release-notes/5914.md
is excluded by!**/*.md
📒 Files selected for processing (1)
packages/sync-server/src/app-gocardless/banks/cetelem_cetmptp1xxx.js
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)
Use TypeScript for all code
Files:
packages/sync-server/src/app-gocardless/banks/cetelem_cetmptp1xxx.js
🔇 Additional comments (1)
packages/sync-server/src/app-gocardless/banks/cetelem_cetmptp1xxx.js (1)
12-22
: No changes needed: mutating core fields on transaction and using an unmodified copy as editedTrans aligns with Fallback.normalizeTransaction(transaction, booked, editedTrans) signature and existing adapters.
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.
Could you change this to spread the old object in? it's a little more future proof
packages/sync-server/src/app-gocardless/banks/cetelem_cetmptp1xxx.js
Outdated
Show resolved
Hide resolved
Change based on code review suggestion Co-authored-by: Matt Fiddaman <[email protected]>
Absolutely! And thanks for the review. |
Sign of transaction amount needs to be flipped for Cetelem Black credit cards.