fix(grid-visualizer): sync with account schema changes#419
Conversation
Update Grid Visualizer to match recent OpenAPI schema changes: - Add bankName field to PKR_ACCOUNT (required for MOBILE_MONEY rails) - Add countryOfResidence to generated beneficiary objects (now required for BDT, GHS, HTG, JMD, PKR currencies) These changes align the visualizer's generated API examples with the current OpenAPI schemas updated in commits aaffef5 and 10da9cc. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummarySyncs the Grid Visualizer with recent OpenAPI schema changes from PRs #416 and #418: adds Confidence Score: 4/5Safe to merge — only visualizer/example-generation code is touched and the sole concern is a semantic approximation in example data. No P0 or P1 issues found. The single P2 finding (reusing
|
| Filename | Overview |
|---|---|
| components/grid-visualizer/src/data/account-types.ts | Adds bankName field to PKR_ACCOUNT spec with an informative description noting Mobile Money requirement; straightforward data addition with no logic concerns. |
| components/grid-visualizer/src/lib/code-generator.ts | Adds countryOfResidence to generated beneficiary object, but reuses the nationality value rather than a distinct field — semantically imprecise for example data but otherwise correct. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[buildAccountInfoBody] --> B{spec.beneficiaryRequired?}
B -- No --> E[return accountInfo]
B -- Yes --> C[Build beneficiary object]
C --> C1[beneficiaryType: INDIVIDUAL]
C --> C2[fullName]
C --> C3[birthDate]
C --> C4[nationality]
C --> C5["countryOfResidence ← nationality (new)"]
C1 & C2 & C3 & C4 & C5 --> D[info.beneficiary = ...]
D --> E
F[PKR_ACCOUNT spec] --> G[fields: accountNumber, phoneNumber, iban]
G --> H["bankName: 'HBL' (new, Required for Mobile Money)"]
Prompt To Fix All With AI
This is a comment left during a code review.
Path: components/grid-visualizer/src/lib/code-generator.ts
Line: 58
Comment:
**`countryOfResidence` reuses `nationality` value**
`nationality` (country of citizenship) and `countryOfResidence` (country of current habitation) are distinct fields in the schema. Conflating them in the generated example may mislead developers who copy the snippet and assume the same value should be passed for both. Consider either adding a dedicated `countryOfResidence` field to `ExamplePerson`, or using a static placeholder that makes the distinction clear (e.g., `'US'` as a generic residency example separate from the nationality value).
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(grid-visualizer): sync with account ..." | Re-trigger Greptile
| fullName: sel.examplePerson.fullName, | ||
| birthDate: '1985-06-20', | ||
| nationality: sel.examplePerson.nationality, | ||
| countryOfResidence: sel.examplePerson.nationality, |
There was a problem hiding this comment.
countryOfResidence reuses nationality value
nationality (country of citizenship) and countryOfResidence (country of current habitation) are distinct fields in the schema. Conflating them in the generated example may mislead developers who copy the snippet and assume the same value should be passed for both. Consider either adding a dedicated countryOfResidence field to ExamplePerson, or using a static placeholder that makes the distinction clear (e.g., 'US' as a generic residency example separate from the nationality value).
Prompt To Fix With AI
This is a comment left during a code review.
Path: components/grid-visualizer/src/lib/code-generator.ts
Line: 58
Comment:
**`countryOfResidence` reuses `nationality` value**
`nationality` (country of citizenship) and `countryOfResidence` (country of current habitation) are distinct fields in the schema. Conflating them in the generated example may mislead developers who copy the snippet and assume the same value should be passed for both. Consider either adding a dedicated `countryOfResidence` field to `ExamplePerson`, or using a static placeholder that makes the distinction clear (e.g., `'US'` as a generic residency example separate from the nationality value).
How can I resolve this? If you propose a fix, please make it concise.
Summary
Updates Grid Visualizer to align with recent OpenAPI schema changes:
bankNamefield (required for MOBILE_MONEY rails per schema update)countryOfResidencefield (now required for BDT, GHS, HTG, JMD, PKR currencies)Context
Recent schema syncs in #418 and #416 changed field requirements:
bankNameremoved as required from most currencies, but remains needed for PKR MOBILE_MONEYcountryOfResidenceadded as required for several beneficiary schemasChanges
account-types.tsbankNameto PKR_ACCOUNT fieldscode-generator.tscountryOfResidencein generated beneficiaryTest plan
bankNamecountryOfResidence🤖 Generated with Claude Code