Add CNY bank-transfer rail (B2B) alongside mobile wallet#554
Conversation
CNY currently supports only the MOBILE_MONEY rail (individual beneficiary). Add the BANK_TRANSFER rail so CNY accounts can target a bank account, mirroring the dual-rail COP schema: - CnyAccountInfoBase: bankName is now the only required field beyond accountType; phoneNumber becomes optional (MOBILE_MONEY only) and a new optional accountNumber is added (BANK_TRANSFER only). Per-rail requirements are documented on the schema and enforced at the application layer, same as COP. - CnyAccountInfo: add BANK_TRANSFER to the paymentRails enum. The beneficiary oneOf already supports BUSINESS (BusinessBeneficiary) in addition to INDIVIDUAL, so the business-to-business shape the bank rail requires (legalName + address) needs no further schema change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
✱ Stainless preview builds for gridThis PR will update the cli csharp go kotlin openapi php python ruby typescript ✅ grid-ruby studio · code
|
Greptile SummaryThis PR extends the CNY account schema to support a
Confidence Score: 5/5Safe to merge — the changes are additive schema relaxations that mirror the well-established COP dual-rail pattern, with no removals of existing valid fields. The change removes phoneNumber from required (a backward-compatible relaxation), adds an optional accountNumber, and extends the paymentRails enum — all closely following the COP template. The bundled YAML files match the source schemas exactly. No logic or runtime code is touched; per-rail enforcement remains at the application layer as with COP. No files require special attention. The source YAML schemas and their two bundled counterparts are all consistent.
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/common/CnyAccountInfoBase.yaml | Removes phoneNumber from required fields, adds optional accountNumber for BANK_TRANSFER rail, updates description and example to cover both rails — mirrors CopAccountInfoBase pattern cleanly. |
| openapi/components/schemas/common/CnyAccountInfo.yaml | Adds BANK_TRANSFER to the paymentRails enum, consistent with the CopAccountInfo pattern. |
| openapi.yaml | Bundled output reflecting CnyAccountInfoBase and CnyAccountInfo changes; content mirrors the source YAML files exactly. |
| mintlify/openapi.yaml | Mintlify-facing bundled output; identical changes to openapi.yaml, no separate concerns. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[CNY Payout Request] --> B{paymentRails}
B -->|MOBILE_MONEY| C[Required: bankName\nRequired: phoneNumber\nOptional: accountNumber]
B -->|BANK_TRANSFER| D[Required: bankName\nRequired: accountNumber\nOptional: phoneNumber]
C --> E{Schema validation}
D --> E
E -->|bankName present| F[Pass schema layer]
F --> G[Application layer enforces\nper-rail required fields]
G --> H[Payout processed]
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
openapi/components/schemas/common/CnyAccountInfoBase.yaml:15-19
The `accountNumber` property has no inline `example`, whereas `phoneNumber` includes `example: '+1234567890'`. The `CopAccountInfoBase.yaml` counterpart also omits it, so this isn't a breaking inconsistency, but adding one here would give tooling (e.g. Mintlify "Try it" panels, code generators) a concrete value to use for the BANK_TRANSFER rail without relying solely on the top-level `example` block.
```suggestion
accountNumber:
type: string
description: The destination bank account number (BANK_TRANSFER rail)
example: '1234567890'
minLength: 1
maxLength: 34
```
Reviews (3): Last reviewed commit: "Address review: include phoneNumber in C..." | Re-trigger Greptile
The example only showed the BANK_TRANSFER fields (accountNumber + bankName); add phoneNumber back so MOBILE_MONEY consumers have an inline reference for every supported field, matching the CopAccountInfoBase example convention. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@greptileai please re-review |
## Summary - Added `Mobile Money` to CNY `allRails` array (alongside `Bank Transfer`) - Added `accountNumber` field to `CNY_ACCOUNT` spec for BANK_TRANSFER rail - Added field descriptions clarifying which fields are for which rail These changes sync the Grid Visualizer data with the OpenAPI schema updates from #554 (commit 2442b86), which added CNY bank-transfer rail (B2B) alongside mobile wallet. ## Test plan - [ ] Verify Grid Visualizer generates correct CNY account info for both rails - [ ] Verify code samples include `accountNumber` when BANK_TRANSFER rail is selected 🤖 Generated with [Claude Code](https://claude.ai/claude-code) Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Summary
Adds the
BANK_TRANSFERrail to the CNY account schema so CNY payouts can target a bank account (business-to-business), in addition to the existingMOBILE_MONEYwallet rail. Mirrors the dual-railCOPschema pattern.Changes
CnyAccountInfoBase.yaml:bankNameis now the only required field beyondaccountType.phoneNumberbecomes optional (MOBILE_MONEYonly); new optionalaccountNumberadded (BANK_TRANSFERonly). Per-rail requirements documented on the schema and enforced at the application layer, exactly likeCOP.CnyAccountInfo.yaml: addBANK_TRANSFERto thepaymentRailsenum.The
beneficiaryoneOf already supportsBUSINESS(BusinessBeneficiary) alongsideINDIVIDUAL, so the B2B shape the bank rail requires (legalName+address) needs no further schema change. The credit-party identifier for the bank rail is justbank_account_number(confirmed against the live payer requirements).Test plan
npm run build:openapibundles cleanlygrid_apiin webdev, wire the bank rail in sparkcore (rails config, fields provider, account.py, B2B transaction-type resolution), add itests