✨ server: add bank beneficiary address to deposit details#894
✨ server: add bank beneficiary address to deposit details#894
Conversation
🦋 Changeset detectedLatest commit: 4b8b47a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the deposit details functionality by introducing a new field for the bank beneficiary address. This change ensures that more comprehensive banking information can be processed and displayed, improving the clarity and completeness of deposit instructions for users. The update involves schema modifications, data mapping logic, and corresponding test adjustments. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughAdds a new beneficiaryAddress string field to USD deposit details for ACH and WIRE across API schema, bridge mapping, tests, and a changeset entry for a patch release. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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.
Code Review
This pull request introduces a new bankBeneficiaryAddress field to the deposit details, updating the @exactly/server API schema to include this string type. The change involves modifying the DepositDetails variant in server/api/ramp.ts and propagating the bank_beneficiary_address from virtual account instructions into the deposit details within server/utils/ramps/bridge.ts. Corresponding test cases in server/test/api/ramp.test.ts and server/test/utils/bridge.test.ts have been updated to include this new field, ensuring its proper handling and integration.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
server/utils/ramps/bridge.ts (1)
903-915:⚠️ Potential issue | 🟠 MajorHarden USD deposit mapping against optional Bridge provider fields.
Lines 903 and 915 assume
bank_beneficiary_addressis always present. Bridge's API does not guarantee this field for USD virtual accounts—it is not in the required schema and is documented as wire-only. Older accounts and ACH deposits may not include it. Add defensive handling with an optional fallback.Proposed fix
@@ object({ currency: literal("usd" as const satisfies (typeof BridgeCurrency)[number]), payment_rails: array(picklist(["ach_push", "wire"] as const satisfies (typeof PaymentRail)[number][])), bank_name: string(), bank_address: string(), bank_routing_number: string(), bank_account_number: string(), bank_beneficiary_name: string(), - bank_beneficiary_address: string(), + bank_beneficiary_address: optional(string()), }), @@ - bankBeneficiaryAddress: virtualAccount.source_deposit_instructions.bank_beneficiary_address, + bankBeneficiaryAddress: + virtualAccount.source_deposit_instructions.bank_beneficiary_address ?? + virtualAccount.source_deposit_instructions.bank_address, @@ - bankBeneficiaryAddress: virtualAccount.source_deposit_instructions.bank_beneficiary_address, + bankBeneficiaryAddress: + virtualAccount.source_deposit_instructions.bank_beneficiary_address ?? + virtualAccount.source_deposit_instructions.bank_address,
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: ee14432c-1587-41e3-9caa-0649278bd896
📒 Files selected for processing (5)
.changeset/cohk-ogyn-nhcy.mdserver/api/ramp.tsserver/test/api/ramp.test.tsserver/test/utils/bridge.test.tsserver/utils/ramps/bridge.ts
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #894 +/- ##
=======================================
Coverage 71.47% 71.47%
=======================================
Files 212 212
Lines 8469 8469
Branches 2775 2773 -2
=======================================
Hits 6053 6053
Misses 2134 2134
Partials 282 282
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary by CodeRabbit
New Features
Tests
Chores