Skip to content

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

Open
mainqueg wants to merge 1 commit intomainfrom
beneficiary
Open

✨ server: add bank beneficiary address to deposit details#894
mainqueg wants to merge 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: 4b8b47a

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: 66836b6e-5c39-44d1-91c0-79b5f87adf96

📥 Commits

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

📒 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 maps virtualAccount.source_deposit_instructions.bank_beneficiary_address into beneficiaryAddress on returned USD deposit detail objects.
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
  • cruzdanilo
🚥 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 accurately and concisely summarizes the main change: adding a bank beneficiary address field to deposit details in the server module.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (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 (d599828) to head (4b8b47a).
✅ All tests successful. No failed tests found.

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

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.

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.

1 participant