Skip to content

Commit cd58890

Browse files
authored
fix: updating samples and components for schema updates (#241)
Updating the kotlin sample and grid visualizer component for the latest api changes
1 parent e7b9bf6 commit cd58890

11 files changed

Lines changed: 497 additions & 225 deletions

File tree

.github/workflows/docs-sync.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
claude_args:
8888
--allowedTools Bash,Read,Write,Edit,Glob,Grep,WebFetch
8989
--model claude-opus-4-5-20251101
90-
--max-turns 30
90+
--max-turns 45
9191
prompt: |
9292
## Task: Documentation Sync Review
9393
@@ -123,22 +123,36 @@ jobs:
123123
- `mintlify/snippets/` - Shared content snippets
124124
- `mintlify/platform-overview/` - Core concepts
125125
126-
4. **Check for Outdated References**
126+
4. **Check Kotlin Sample App**
127+
- Review `samples/kotlin/src/main/kotlin/com/grid/sample/routes/` for route handlers that reference changed schemas
128+
- Check that request body construction matches current OpenAPI schemas (field names, required fields, enum values)
129+
- Verify external account creation handlers support all current `ExternalAccountType` enum values from `openapi/components/schemas/external_accounts/ExternalAccountType.yaml`
130+
- Check that webhook handling in `Webhooks.kt` matches current webhook schemas
131+
- Check that quote creation in `Quotes.kt` includes all required fields
132+
- Verify SDK method calls match the schema structure (e.g., beneficiary nested inside accountInfo, paymentRails included)
133+
134+
5. **Check Grid Visualizer Data**
135+
- Review `components/grid-visualizer/src/data/account-types.ts` — account type keys and field specs must match `ExternalAccountType` enum values and their corresponding `*AccountInfo.yaml` schemas in `openapi/components/schemas/common/`
136+
- Review `components/grid-visualizer/src/data/currencies.ts` — `accountType` values must match `ExternalAccountType` enum, `allRails` and `instantRails` must match the `paymentRails` enum values in each account info schema
137+
- Review `components/grid-visualizer/src/data/crypto.ts` — crypto account types must match wallet types in the ExternalAccountType enum
138+
- Review `components/grid-visualizer/src/lib/code-generator.ts` — generated API call bodies must match current request schemas (e.g., `accountInfo` structure, `paymentRails` inclusion, beneficiary format)
139+
140+
6. **Check for Outdated References**
127141
- Look for hardcoded field names that may have changed
128142
- Check for endpoint paths that may have been renamed
129143
- Verify response structure descriptions match the schema
130144
131145
### Actions
132146
133-
If documentation updates are needed:
134-
1. Make the necessary changes to keep docs in sync
147+
If updates are needed in any area (docs, Kotlin sample, or Grid Visualizer):
148+
1. Make the necessary changes to keep everything in sync with the OpenAPI schema
135149
2. Run `npm run build:openapi` if you modified any files in `openapi/`
136-
3. Create a PR with:
150+
3. Create a single PR with all changes:
137151
- Branch name: `docs/sync-$(date +%Y%m%d)`
138152
- Clear title describing the sync
139-
- Description listing what was updated and why
153+
- Description listing what was updated and why, organized by area (docs, Kotlin sample, Grid Visualizer)
140154
141-
If documentation is already up to date:
155+
If everything is already up to date:
142156
- Output a brief summary confirming no updates needed
143157
- Do not create a PR
144158

components/grid-visualizer/src/data/account-types.ts

Lines changed: 154 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,27 @@ export interface AccountFieldSpec {
77
export interface AccountTypeSpec {
88
accountType: string;
99
fields: AccountFieldSpec[];
10+
paymentRails?: string[];
1011
beneficiaryRequired: boolean;
11-
purposeOfPaymentRequired?: boolean;
1212
}
1313

1414
export const accountTypeSpecs: Record<string, AccountTypeSpec> = {
15-
US_ACCOUNT: {
16-
accountType: 'US_ACCOUNT',
15+
USD_ACCOUNT: {
16+
accountType: 'USD_ACCOUNT',
1717
fields: [
1818
{ name: 'accountNumber', example: '123456789' },
1919
{ name: 'routingNumber', example: '021000021' },
20-
{ name: 'accountCategory', example: 'CHECKING', description: 'CHECKING or SAVINGS' },
2120
],
21+
paymentRails: ['ACH', 'WIRE', 'RTP', 'FEDNOW'],
2222
beneficiaryRequired: true,
2323
},
24-
IBAN: {
25-
accountType: 'IBAN',
24+
EUR_ACCOUNT: {
25+
accountType: 'EUR_ACCOUNT',
2626
fields: [
2727
{ name: 'iban', example: 'DE89370400440532013000' },
28-
{ name: 'swiftBic', example: 'DEUTDEFF' },
28+
{ name: 'swiftBic', example: 'DEUTDEFF', description: 'Optional' },
2929
],
30+
paymentRails: ['SEPA', 'SEPA_INSTANT'],
3031
beneficiaryRequired: true,
3132
},
3233
GBP_ACCOUNT: {
@@ -35,29 +36,42 @@ export const accountTypeSpecs: Record<string, AccountTypeSpec> = {
3536
{ name: 'sortCode', example: '20-00-00' },
3637
{ name: 'accountNumber', example: '12345678' },
3738
],
39+
paymentRails: ['FASTER_PAYMENTS'],
3840
beneficiaryRequired: true,
3941
},
40-
PIX: {
41-
accountType: 'PIX',
42+
BRL_ACCOUNT: {
43+
accountType: 'BRL_ACCOUNT',
4244
fields: [
4345
{ name: 'pixKey', example: '55119876543210' },
4446
{ name: 'pixKeyType', example: 'PHONE', description: 'CPF, CNPJ, EMAIL, PHONE, or RANDOM' },
4547
{ name: 'taxId', example: '12345678901' },
4648
],
49+
paymentRails: ['PIX'],
4750
beneficiaryRequired: true,
4851
},
49-
CLABE: {
50-
accountType: 'CLABE',
52+
MXN_ACCOUNT: {
53+
accountType: 'MXN_ACCOUNT',
5154
fields: [
5255
{ name: 'clabeNumber', example: '123456789012345678' },
5356
],
57+
paymentRails: ['SPEI'],
5458
beneficiaryRequired: true,
5559
},
56-
UPI: {
57-
accountType: 'UPI',
60+
INR_ACCOUNT: {
61+
accountType: 'INR_ACCOUNT',
5862
fields: [
5963
{ name: 'vpa', example: 'customer@okbank' },
6064
],
65+
paymentRails: ['UPI'],
66+
beneficiaryRequired: true,
67+
},
68+
DKK_ACCOUNT: {
69+
accountType: 'DKK_ACCOUNT',
70+
fields: [
71+
{ name: 'iban', example: 'DK5000400440116243' },
72+
{ name: 'swiftBic', example: 'NDEADKKK', description: 'Optional' },
73+
],
74+
paymentRails: ['SEPA', 'SEPA_INSTANT'],
6175
beneficiaryRequired: true,
6276
},
6377
NGN_ACCOUNT: {
@@ -66,8 +80,8 @@ export const accountTypeSpecs: Record<string, AccountTypeSpec> = {
6680
{ name: 'accountNumber', example: '0123456789' },
6781
{ name: 'bankName', example: 'First Bank of Nigeria' },
6882
],
83+
paymentRails: ['BANK_TRANSFER'],
6984
beneficiaryRequired: true,
70-
purposeOfPaymentRequired: true,
7185
},
7286
CAD_ACCOUNT: {
7387
accountType: 'CAD_ACCOUNT',
@@ -76,6 +90,7 @@ export const accountTypeSpecs: Record<string, AccountTypeSpec> = {
7690
{ name: 'branchCode', example: '00012' },
7791
{ name: 'accountNumber', example: '1234567' },
7892
],
93+
paymentRails: ['BANK_TRANSFER'],
7994
beneficiaryRequired: true,
8095
},
8196
PHP_ACCOUNT: {
@@ -84,6 +99,7 @@ export const accountTypeSpecs: Record<string, AccountTypeSpec> = {
8499
{ name: 'bankName', example: 'BDO Unibank' },
85100
{ name: 'accountNumber', example: '001234567890' },
86101
],
102+
paymentRails: ['BANK_TRANSFER'],
87103
beneficiaryRequired: true,
88104
},
89105
SGD_ACCOUNT: {
@@ -93,6 +109,130 @@ export const accountTypeSpecs: Record<string, AccountTypeSpec> = {
93109
{ name: 'swiftCode', example: 'DBSSSGSG' },
94110
{ name: 'accountNumber', example: '0123456789' },
95111
],
112+
paymentRails: ['PAYNOW', 'FAST', 'BANK_TRANSFER'],
113+
beneficiaryRequired: true,
114+
},
115+
HKD_ACCOUNT: {
116+
accountType: 'HKD_ACCOUNT',
117+
fields: [
118+
{ name: 'bankName', example: 'HSBC Hong Kong' },
119+
{ name: 'accountNumber', example: '123456789012' },
120+
{ name: 'swiftCode', example: 'HSBCHKHHHKH' },
121+
],
122+
paymentRails: ['BANK_TRANSFER'],
123+
beneficiaryRequired: true,
124+
},
125+
IDR_ACCOUNT: {
126+
accountType: 'IDR_ACCOUNT',
127+
fields: [
128+
{ name: 'accountNumber', example: '1234567890' },
129+
{ name: 'bankName', example: 'Bank Central Asia' },
130+
{ name: 'swiftCode', example: 'CENAIDJA' },
131+
{ name: 'phoneNumber', example: '+6281234567890' },
132+
],
133+
paymentRails: ['BANK_TRANSFER'],
134+
beneficiaryRequired: true,
135+
},
136+
KES_ACCOUNT: {
137+
accountType: 'KES_ACCOUNT',
138+
fields: [
139+
{ name: 'phoneNumber', example: '+254712345678' },
140+
{ name: 'provider', example: 'M-PESA', description: 'Mobile money provider' },
141+
],
142+
paymentRails: ['MOBILE_MONEY'],
143+
beneficiaryRequired: true,
144+
},
145+
MYR_ACCOUNT: {
146+
accountType: 'MYR_ACCOUNT',
147+
fields: [
148+
{ name: 'bankName', example: 'Maybank' },
149+
{ name: 'accountNumber', example: '1234567890' },
150+
{ name: 'swiftCode', example: 'MABORUMMYYY' },
151+
],
152+
paymentRails: ['BANK_TRANSFER'],
153+
beneficiaryRequired: true,
154+
},
155+
RWF_ACCOUNT: {
156+
accountType: 'RWF_ACCOUNT',
157+
fields: [
158+
{ name: 'phoneNumber', example: '+250781234567' },
159+
{ name: 'provider', example: 'MTN', description: 'MTN or AIRTEL' },
160+
],
161+
paymentRails: ['MOBILE_MONEY'],
162+
beneficiaryRequired: true,
163+
},
164+
THB_ACCOUNT: {
165+
accountType: 'THB_ACCOUNT',
166+
fields: [
167+
{ name: 'bankName', example: 'Bangkok Bank' },
168+
{ name: 'accountNumber', example: '1234567890' },
169+
{ name: 'swiftCode', example: 'BKKBTHBK' },
170+
],
171+
paymentRails: ['BANK_TRANSFER'],
172+
beneficiaryRequired: true,
173+
},
174+
TZS_ACCOUNT: {
175+
accountType: 'TZS_ACCOUNT',
176+
fields: [
177+
{ name: 'phoneNumber', example: '+255712345678' },
178+
{ name: 'provider', example: 'VODACOM', description: 'AIRTEL or VODACOM' },
179+
],
180+
paymentRails: ['MOBILE_MONEY'],
181+
beneficiaryRequired: true,
182+
},
183+
VND_ACCOUNT: {
184+
accountType: 'VND_ACCOUNT',
185+
fields: [
186+
{ name: 'bankName', example: 'Vietcombank' },
187+
{ name: 'accountNumber', example: '1234567890' },
188+
{ name: 'swiftCode', example: 'BFTVVNVX' },
189+
],
190+
paymentRails: ['BANK_TRANSFER'],
191+
beneficiaryRequired: true,
192+
},
193+
ZAR_ACCOUNT: {
194+
accountType: 'ZAR_ACCOUNT',
195+
fields: [
196+
{ name: 'accountNumber', example: '1234567890' },
197+
{ name: 'bankName', example: 'Standard Bank' },
198+
],
199+
paymentRails: ['BANK_TRANSFER'],
200+
beneficiaryRequired: true,
201+
},
202+
ZMW_ACCOUNT: {
203+
accountType: 'ZMW_ACCOUNT',
204+
fields: [
205+
{ name: 'phoneNumber', example: '+260971234567' },
206+
{ name: 'provider', example: 'MTN', description: 'TNM, AIRTEL, ZAMTEL, or MTN' },
207+
],
208+
paymentRails: ['MOBILE_MONEY'],
209+
beneficiaryRequired: true,
210+
},
211+
MWK_ACCOUNT: {
212+
accountType: 'MWK_ACCOUNT',
213+
fields: [
214+
{ name: 'phoneNumber', example: '+265991234567' },
215+
{ name: 'provider', example: 'AIRTEL', description: 'Mobile money provider' },
216+
],
217+
paymentRails: ['MOBILE_MONEY'],
218+
beneficiaryRequired: true,
219+
},
220+
UGX_ACCOUNT: {
221+
accountType: 'UGX_ACCOUNT',
222+
fields: [
223+
{ name: 'phoneNumber', example: '+256771234567' },
224+
{ name: 'provider', example: 'MTN', description: 'Mobile money provider' },
225+
],
226+
paymentRails: ['MOBILE_MONEY'],
227+
beneficiaryRequired: true,
228+
},
229+
XOF_ACCOUNT: {
230+
accountType: 'XOF_ACCOUNT',
231+
fields: [
232+
{ name: 'phoneNumber', example: '+221771234567' },
233+
{ name: 'provider', example: 'ORANGE', description: 'Mobile money provider' },
234+
],
235+
paymentRails: ['MOBILE_MONEY'],
96236
beneficiaryRequired: true,
97237
},
98238
SPARK_WALLET: {
@@ -137,23 +277,4 @@ export const accountTypeSpecs: Record<string, AccountTypeSpec> = {
137277
],
138278
beneficiaryRequired: false,
139279
},
140-
// --- Generic bank transfer account types (best-guess, confirm with API team) ---
141-
...Object.fromEntries(
142-
[
143-
'XOF_ACCOUNT', 'XAF_ACCOUNT', 'GHS_ACCOUNT', 'KES_ACCOUNT', 'ZAR_ACCOUNT',
144-
'BWP_ACCOUNT', 'TZS_ACCOUNT', 'UGX_ACCOUNT', 'MWK_ACCOUNT', 'ZMW_ACCOUNT',
145-
'CNY_ACCOUNT', 'HKD_ACCOUNT', 'IDR_ACCOUNT', 'KRW_ACCOUNT', 'MYR_ACCOUNT',
146-
'THB_ACCOUNT', 'VND_ACCOUNT', 'LKR_ACCOUNT', 'CRC_ACCOUNT', 'CDF_ACCOUNT',
147-
].map((type) => [
148-
type,
149-
{
150-
accountType: type,
151-
fields: [
152-
{ name: 'accountNumber', example: '0123456789' },
153-
{ name: 'bankName', example: 'Local Bank' },
154-
],
155-
beneficiaryRequired: true,
156-
} satisfies AccountTypeSpec,
157-
]),
158-
),
159280
};

0 commit comments

Comments
 (0)