Conversation
🦋 Changeset detectedLatest commit: d28280b The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThe PR adds Bridge business customer creation and KYC submission. It propagates business account types through Bridge ramp operations, updates business-field mapping, and expands test coverage. ChangesBridge business KYB
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Client
participant KYCRoute
participant BridgeService
participant BridgeAPI
participant Database
Client->>KYCRoute: Submit bridge business application
KYCRoute->>BridgeService: Create business customer
BridgeService->>BridgeAPI: POST /customers
BridgeAPI-->>BridgeService: Customer id
KYCRoute->>Database: Store bridgeId
KYCRoute->>BridgeService: Fetch business KYC link
BridgeService->>BridgeAPI: GET customer kyc_link
BridgeAPI-->>KYCRoute: KYC link
KYCRoute-->>Client: Pending status and kycLink
Suggested reviewers: Merge Risk: 🟡 Moderate · up to Clients polling a successfully submitted Bridge KYB application receive an incorrect “not started” response. The Bridge status path should be implemented before merge. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
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.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: ca6a698a-c307-4057-a3ff-9debf4b4b20c
📒 Files selected for processing (12)
.changeset/quiet-bridges-kyb.md.changeset/quiet-kybs-map.mdserver/api/index.tsserver/api/kyc.tsserver/api/ramp.tsserver/test/api/kyc.test.tsserver/test/api/ramp.test.tsserver/test/hooks/persona.test.tsserver/test/utils/bridge.test.tsserver/utils/panda.tsserver/utils/persona.tsserver/utils/ramps/bridge.ts
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
server/api/kyc.ts (1)
896-899: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftMake application status provider-aware.
The Bridge submission calls
panda.businessApplicationonly to build request data, creates a Bridge customer, storescredentials.bridgeId, and returns"pending"without creating a Panda company application. GET/applicationthen calls onlypanda.getCompanyApplication(credentialId)and returns"not started"when that application is absent. Resolve Bridge status frombridgeId, or expose a separate provider-specific Bridge status endpoint.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 1bf53970-b5bf-4d9c-aa75-7bb1f01e0409
📒 Files selected for processing (6)
server/api/kyc.tsserver/api/ramp.tsserver/test/api/kyc.test.tsserver/test/api/ramp.test.tsserver/test/utils/bridge.test.tsserver/utils/ramps/bridge.ts
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 66f0a626-c698-4b20-90d0-3f929289658c
📒 Files selected for processing (5)
server/api/kyc.tsserver/test/api/kyc.test.tsserver/test/utils/bridge.test.tsserver/test/utils/panda.test.tsserver/utils/panda.ts
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟠 Major · Return Bridge KYB status for Bridge customers. · server/api/kyc.ts:894-897
894-897: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winReturn Bridge KYB status for Bridge customers.
The Bridge submission path stores
credentials.bridgeId, butGET /applicationdoes not selectbridgeIdor handle it before the Panda branch. For a Bridge credential without a Panda company application,panda.getCompanyApplication(credentialId)returns no application and the endpoint returns HTTP 400 with"not started".Select
bridgeId, call the exposedbridge.getCustomer(bridgeId, "business"), and map itsCustomerResponse.statusto the endpoint status before querying Panda. Add a regression test that submits a Bridge application and then retrieves its status.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 28839f0d-65b6-4d83-bed8-f977c2511c78
📒 Files selected for processing (2)
server/api/kyc.tsserver/test/api/kyc.test.ts
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8492a9d163
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 01df67fcd5
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## panda-b2b-approvals #1302 +/- ##
=======================================================
+ Coverage 74.47% 74.63% +0.15%
=======================================================
Files 298 298
Lines 12523 12557 +34
Branches 4474 4488 +14
=======================================================
+ Hits 9327 9372 +45
+ Misses 2956 2942 -14
- Partials 240 243 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
3d15857 to
d25a604
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a00e6e893
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d25a604 to
2d95b37
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b93b785ca9
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4bb019cc2d
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf0c3a2b3b
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0eff588d0c
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| **Business KYB** | ||
|
|
||
| Business requests are identified by the \`account-type: business\` request header and require a business credential (non-zero salt), otherwise the endpoint returns \`400 { "code": "not supported" }\`. The body must be exactly one of two variants: |
There was a problem hiding this comment.
Document the actual business-routing mechanism
This OpenAPI description tells integrators that account-type: business identifies a business request, but the header validator does not declare that header and the handler routes exclusively by comparing the authenticated credential's salt to businessSalt. Consequently, adding the documented header to a personal credential has no effect, while a business credential succeeds without it. Either define and consume the header or describe the salt-derived credential behavior accurately so generated documentation does not advertise a nonexistent request control. .agents/rules/server.mdL23-L25
Useful? React with 👍 / 👎.
summary
add bridge kyb for business credentials: on approval, create the bridge business customer with the minimum fields and send the user to the bridge hosted kyc link.
stacked on #1209.
changes
scope: "bridge"withacceptedTermsIdinPOST /kyc, create the bridge business customer idempotently, persistbridgeId, and return{ kycLink, status: "pending" }bridge.createBusinessCustomerand sendaccount-type: businesson customer creation, tos links, and kyc linksramproutes to resolve the business account type, and reject bridge business onboarding therealready onboardedwhen the credential already has a bridge idtest plan
pnpm nx test:vi serverPOST /kycin sandbox and verify the returned bridge kyc linkSummary by CodeRabbit