✨ server: add bank beneficiary address to deposit details#894
✨ server: add bank beneficiary address to deposit details#894cruzdanilo merged 1 commit intomainfrom
Conversation
🦋 Changeset detectedLatest commit: d2c5fd2 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 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 docstrings
🧪 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 70.72% 71.47% +0.74%
==========================================
Files 211 212 +1
Lines 8466 8469 +3
Branches 2772 2775 +3
==========================================
+ Hits 5988 6053 +65
+ Misses 2196 2134 -62
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:
|
There was a problem hiding this comment.
💡 Codex Review
exa/server/utils/ramps/bridge.ts
Line 797 in d2c5fd2
bank_beneficiary_address optional in USD virtual accounts
getDepositDetails() always calls getVirtualAccounts() before returning USD instructions, so this schema now has to accept whatever GET /customers/{customerId}/virtual_accounts returns. I checked Bridge’s docs for that exact endpoint (Additional functionality), and the sample USD responses include bank_beneficiary_name, bank_name, bank_address, bank_account_number, and bank_routing_number but omit bank_beneficiary_address. With this field marked required here, Valibot will reject those existing virtual accounts and /api/ramp/quote?provider=bridge¤cy=USD will start 500ing for customers who already have a Bridge virtual account instead of returning ACH/WIRE details.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Summary by CodeRabbit
New Features
Tests
Chores