-
-
Notifications
You must be signed in to change notification settings - Fork 656
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
Add proper transaction formatting for Stadtsparkasse Düsseldorf (Germany) #531
base: master
Are you sure you want to change the base?
Conversation
Warning Rate limit exceeded@DennaGherlyn has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 7 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe pull request introduces a new bank integration for SSK Düsseldorf (DUSSELDORF_DUSSDEDDXXX) into the existing bank factory system. This includes adding a new module The new bank module implements a method called The changes are primarily additive, expanding the existing bank integration framework without altering the core functionality of the bank factory or the transaction processing system. Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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/531.md
is excluded by!**/*.md
📒 Files selected for processing (2)
src/app-gocardless/bank-factory.js
(2 hunks)src/app-gocardless/banks/ssk-dusseldorf-dussdeddxxx.js
(1 hunks)
🔇 Additional comments (7)
src/app-gocardless/banks/ssk-dusseldorf-dussdeddxxx.js (5)
1-2
: Looks good - fallback import is consistent.
No issues found here.
3-4
: Great choice on reusing formatPayeeName
.
This helps maintain a consistent payee display across all bank integrations.
22-25
: Good practice returning null
if no valid date.
This effectively filters out invalid or incomplete transactions.
38-41
: Appropriately prioritizes ultimateCreditor
over creditorName
.
This addresses scenarios where a third-party provider processes the payment.
47-52
: Efficient and concise transaction normalization.
The final object ensures relevant fields (payeeName
and date
) are exposed as expected.
src/app-gocardless/bank-factory.js (2)
34-34
: New import properly references SSK Düsseldorf bank file.
No observations or issues here.
71-71
: Bank appended correctly to the existing banks array.
The new entry ensures that SSK Düsseldorf is recognized among supported banks.
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.
Thank you for this! I've added a few comments on how to simplify the handler
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: 0
🧹 Nitpick comments (2)
src/app-gocardless/banks/ssk-dusseldorf-dussdeddxxx.js (2)
11-19
: Robust remittance information handlingGood implementation of the remittance information concatenation with proper null handling. The code safely combines information from multiple sources while avoiding the undefined concatenation issue.
Consider adding a brief comment explaining the remittance information priority order:
+ // Prioritize unstructured information, falling back to structured formats let remittanceInformationUnstructured = transaction.remittanceInformationUnstructured ?? transaction.remittanceInformationStructured ?? transaction.remittanceInformationStructuredArray?.join(' ');
🧰 Tools
🪛 eslint
[error] 17-17: Replace
·(remittanceInformationUnstructured·??·'')·
with⏎········(remittanceInformationUnstructured·??·'')·+
(prettier/prettier)
[error] 18-18: Replace
+·'·'·
with··'·'·+
(prettier/prettier)
[error] 19-19: Replace
+
with·
(prettier/prettier)
🪛 GitHub Check: lint
[failure] 17-17:
Replace·(remittanceInformationUnstructured·??·'')·
with⏎········(remittanceInformationUnstructured·??·'')·+
[failure] 18-18:
Replace+·'·'·
with··'·'·+
[failure] 19-19:
Replace+
with·
9-31
: Minor formatting issues detectedThe static analysis tools indicate some formatting inconsistencies. These will be automatically fixed by the project's formatting tools, but for reference:
- Extra newline after function declaration
- Inconsistent concatenation operator spacing
🧰 Tools
🪛 eslint
[error] 10-11: Delete
⏎
(prettier/prettier)
[error] 17-17: Replace
·(remittanceInformationUnstructured·??·'')·
with⏎········(remittanceInformationUnstructured·??·'')·+
(prettier/prettier)
[error] 18-18: Replace
+·'·'·
with··'·'·+
(prettier/prettier)
[error] 19-19: Replace
+
with·
(prettier/prettier)
🪛 GitHub Check: lint
[failure] 10-10:
Delete⏎
[failure] 17-17:
Replace·(remittanceInformationUnstructured·??·'')·
with⏎········(remittanceInformationUnstructured·??·'')·+
[failure] 18-18:
Replace+·'·'·
with··'·'·+
[failure] 19-19:
Replace+
with·
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
upcoming-release-notes/531.md
is excluded by!**/*.md
📒 Files selected for processing (1)
src/app-gocardless/banks/ssk-dusseldorf-dussdeddxxx.js
(1 hunks)
🧰 Additional context used
🪛 eslint
src/app-gocardless/banks/ssk-dusseldorf-dussdeddxxx.js
[error] 10-11: Delete ⏎
(prettier/prettier)
[error] 17-17: Replace ·(remittanceInformationUnstructured·??·'')·
with ⏎········(remittanceInformationUnstructured·??·'')·+
(prettier/prettier)
[error] 18-18: Replace +·'·'·
with ··'·'·+
(prettier/prettier)
[error] 19-19: Replace +
with ·
(prettier/prettier)
🪛 GitHub Check: lint
src/app-gocardless/banks/ssk-dusseldorf-dussdeddxxx.js
[failure] 10-10:
Delete ⏎
[failure] 17-17:
Replace ·(remittanceInformationUnstructured·??·'')·
with ⏎········(remittanceInformationUnstructured·??·'')·+
[failure] 18-18:
Replace +·'·'·
with ··'·'·+
[failure] 19-19:
Replace +
with ·
🔇 Additional comments (3)
src/app-gocardless/banks/ssk-dusseldorf-dussdeddxxx.js (3)
1-6
: Well-structured module setup!Good use of inheritance pattern by extending the fallback implementation while maintaining type safety through JSDoc annotations.
7-8
: Clear bank identificationThe institution ID correctly identifies Stadtsparkasse Düsseldorf using the standard format.
21-30
: Verify creditor name prioritization behaviorThe implementation correctly prioritizes
ultimateCreditor
for third-party payments, which aligns with the PR objectives. However, let's verify this behavior with some test cases.Run the following script to search for existing test coverage:
If no tests are found, would you like me to help create test cases for various creditor name scenarios?
✅ Verification successful
Let me gather more information about the test coverage and implementation patterns.
Let me analyze the test coverage for creditor name handling.
Creditor name prioritization behavior is consistent with other Sparkasse banks
Based on the previous search results, I found that the creditor name prioritization pattern (
ultimateCreditor || creditorName || debtorName
) is consistently implemented across multiple Sparkasse banks:
- berliner_sparkasse_beladebexxx.js
- spk-karlsruhe-karsde66.js
- ssk-dusseldorf-dussdeddxxx.js
While there's no specific test file for SSK Dusseldorf, the implementation follows the established pattern used by other Sparkasse banks in the codebase. The prioritization of
ultimateCreditor
for third-party payments is a common pattern across these implementations.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for test files related to this bank integration fd -e test.js -e spec.js ssk-dusseldorf # Search for similar creditor name handling patterns in other bank implementations ast-grep --pattern 'transaction.ultimateCreditor || transaction.creditorName'Length of output: 685
Script:
#!/bin/bash # Check test files in the app-gocardless directory fd -e test.js -e spec.js . src/app-gocardless # Look for test cases involving creditor name handling rg -A 5 "ultimateCreditor|creditorName" $(fd -e test.js -e spec.js . src/app-gocardless) # Check the implementation in other banks to understand the pattern rg -A 5 "usefulCreditorName" src/app-gocardless/banks/Length of output: 23135
Script:
#!/bin/bash # Check for test file specific to SSK Dusseldorf fd -e test.js -e spec.js ssk-dusseldorf # Look for test cases involving ultimateCreditor rg -A 5 "ultimateCreditor" $(fd -e test.js -e spec.js . src/app-gocardless) # Check the implementation pattern in the Fallback class rg -A 5 "class Fallback" src/app-gocardless/Length of output: 1403
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: 0
🧹 Nitpick comments (1)
src/app-gocardless/banks/ssk-dusseldorf-dussdeddxxx.js (1)
17-20
: Fix code formatting to match project style.The concatenation logic has correct null handling but needs formatting adjustments.
Apply this formatting fix:
- remittanceInformationUnstructured = - (remittanceInformationUnstructured ?? '') - + ' ' - + transaction.additionalInformation; + remittanceInformationUnstructured = + (remittanceInformationUnstructured ?? '') + + ' ' + + transaction.additionalInformation;🧰 Tools
🪛 eslint
[error] 17-17: Delete
·
(prettier/prettier)
[error] 18-18: Insert
·+
(prettier/prettier)
[error] 19-19: Replace
·+·'·'·
with·'·'·+
(prettier/prettier)
[error] 20-20: Delete
·+
(prettier/prettier)
🪛 GitHub Check: lint
[failure] 17-17:
Delete·
[failure] 18-18:
Insert·+
[failure] 19-19:
Replace·+·'·'·
with·'·'·+
[failure] 20-20:
Delete·+
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/app-gocardless/banks/ssk-dusseldorf-dussdeddxxx.js
(1 hunks)
🧰 Additional context used
🪛 eslint
src/app-gocardless/banks/ssk-dusseldorf-dussdeddxxx.js
[error] 17-17: Delete ·
(prettier/prettier)
[error] 18-18: Insert ·+
(prettier/prettier)
[error] 19-19: Replace ·+·'·'·
with ·'·'·+
(prettier/prettier)
[error] 20-20: Delete ·+
(prettier/prettier)
🪛 GitHub Check: lint
src/app-gocardless/banks/ssk-dusseldorf-dussdeddxxx.js
[failure] 17-17:
Delete ·
[failure] 18-18:
Insert ·+
[failure] 19-19:
Replace ·+·'·'·
with ·'·'·+
[failure] 20-20:
Delete ·+
🔇 Additional comments (4)
src/app-gocardless/banks/ssk-dusseldorf-dussdeddxxx.js (4)
1-8
: LGTM! Well-structured module setup.The module correctly extends the base Fallback integration and properly identifies the institution.
11-14
: LGTM! Robust remittance information handling.Good use of nullish coalescing operators for fallback chain, ensuring graceful degradation through different information sources.
22-29
: LGTM! Well-implemented creditor name handling.The implementation correctly addresses the PR objective by prioritizing
ultimateCreditor
for third-party payments while maintaining fallbacks to other creditor sources.
9-32
: Verify the implementation with real transaction data.The implementation looks solid and meets all PR objectives. However, it would be valuable to verify the behavior with real transaction data from SSK Düsseldorf, particularly for third-party payment scenarios.
Would you like me to help create test cases covering various transaction scenarios, especially focusing on third-party payments where
ultimateCreditor
differs fromcreditorName
?🧰 Tools
🪛 eslint
[error] 17-17: Delete
·
(prettier/prettier)
[error] 18-18: Insert
·+
(prettier/prettier)
[error] 19-19: Replace
·+·'·'·
with·'·'·+
(prettier/prettier)
[error] 20-20: Delete
·+
(prettier/prettier)
🪛 GitHub Check: lint
[failure] 17-17:
Delete·
[failure] 18-18:
Insert·+
[failure] 19-19:
Replace·+·'·'·
with·'·'·+
[failure] 20-20:
Delete·+
@matt-fidd Okay, I think I fixed everything you asked. I hope I understood everything correctly. |
This adds a gocardless formatter for the bank Stadtsparkasse Düsseldorf (Germany).
Mainly it fixes the creditor name for cases where payments are managed by a third-party provider by using the
ultimateCreditor
in addition to the other possible fields and fills the notes property.