Skip to content

✨ server: add bank beneficiary address to deposit details#894

Merged
cruzdanilo merged 1 commit intomainfrom
beneficiary
Mar 18, 2026
Merged

✨ server: add bank beneficiary address to deposit details#894
cruzdanilo merged 1 commit intomainfrom
beneficiary

Conversation

@mainqueg
Copy link
Contributor

@mainqueg mainqueg commented Mar 16, 2026

Summary by CodeRabbit

  • New Features

    • Added a bank beneficiary address field to ACH and WIRE deposit details.
  • Tests

    • Updated test fixtures and expected outputs to include the new beneficiary address in deposit details.
  • Chores

    • Added a changeset entry documenting the patch release that includes the new field.

Open with Devin

@changeset-bot
Copy link

changeset-bot bot commented Mar 16, 2026

🦋 Changeset detected

Latest commit: d2c5fd2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@exactly/server Patch

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

@gemini-code-assist
Copy link

Summary of Changes

Hello, 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

  • Schema Update: The DepositDetails schema in server/api/ramp.ts has been extended to include a new field: bankBeneficiaryAddress.
  • Data Mapping: The getDepositDetailsFromVirtualAccount function in server/utils/ramps/bridge.ts now correctly maps the bank_beneficiary_address from virtual account instructions to the DepositDetails object.
  • Test Coverage: Existing test cases in server/test/api/ramp.test.ts and server/test/utils/bridge.test.ts have been updated to include and validate the new bankBeneficiaryAddress field, ensuring proper integration and functionality.
Changelog
  • .changeset/cohk-ogyn-nhcy.md
    • Added a new changeset file to document the addition of the bank beneficiary address to deposit details.
  • server/api/ramp.ts
    • Introduced bankBeneficiaryAddress to the DepositDetails schema for both network variants.
  • server/test/api/ramp.test.ts
    • Updated mock deposit details in API tests to include bankBeneficiaryAddress.
  • server/test/utils/bridge.test.ts
    • Updated mock deposit details in bridge utility tests to include bankBeneficiaryAddress.
  • server/utils/ramps/bridge.ts
    • Mapped bank_beneficiary_address from the virtual account object to the DepositDetails structure.
Activity
  • No human activity was recorded on this pull request since its creation.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 69af26a1-3df7-49d6-80a6-3d9872955b94

📥 Commits

Reviewing files that changed from the base of the PR and between 4b8b47a and d2c5fd2.

📒 Files selected for processing (5)
  • .changeset/cohk-ogyn-nhcy.md
  • server/api/ramp.ts
  • server/test/api/ramp.test.ts
  • server/test/utils/bridge.test.ts
  • server/utils/ramps/bridge.ts

Walkthrough

Adds 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

Cohort / File(s) Summary
Changeset
.changeset/cohk-ogyn-nhcy.md
New changeset documenting a patch release for @exactly/server with changelog "✨ add bank beneficiary address to deposit details".
API schema
server/api/ramp.ts
DepositDetails schema variants for network "ACH" and "WIRE" now include beneficiaryAddress: string().
Bridge mapping & implementation
server/utils/ramps/bridge.ts
getDepositDetailsFromVirtualAccount adds beneficiaryAddress to USD deposit detail objects, sourced from bank_beneficiary_address.
Tests
server/test/api/ramp.test.ts, server/test/utils/bridge.test.ts
Test fixtures and expected outputs updated to include beneficiaryAddress: "456 Beneficiary Ave" for ACH and WIRE deposit details.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • nfmelendez
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'add bank beneficiary address to deposit details' clearly and specifically summarizes the main change across all modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch beneficiary
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 | 🟠 Major

Harden USD deposit mapping against optional Bridge provider fields.

Lines 903 and 915 assume bank_beneficiary_address is 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

📥 Commits

Reviewing files that changed from the base of the PR and between f9f0d0a and 8f27297.

📒 Files selected for processing (5)
  • .changeset/cohk-ogyn-nhcy.md
  • server/api/ramp.ts
  • server/test/api/ramp.test.ts
  • server/test/utils/bridge.test.ts
  • server/utils/ramps/bridge.ts

@mainqueg mainqueg marked this pull request as ready for review March 17, 2026 12:19
Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@sentry
Copy link

sentry bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.47%. Comparing base (5414631) to head (d2c5fd2).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

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              
Flag Coverage Δ
e2e 71.47% <ø> (+5.62%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

bank_beneficiary_address: string(),

P1 Badge Make 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&currency=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".

@cruzdanilo cruzdanilo merged commit d2c5fd2 into main Mar 18, 2026
9 of 11 checks passed
@cruzdanilo cruzdanilo deleted the beneficiary branch March 18, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants