Skip to content

fix(grid-visualizer): sync with account schema changes#419

Merged
pengying merged 1 commit intomainfrom
docs/sync-20260429
Apr 30, 2026
Merged

fix(grid-visualizer): sync with account schema changes#419
pengying merged 1 commit intomainfrom
docs/sync-20260429

Conversation

@claude
Copy link
Copy Markdown
Contributor

@claude claude Bot commented Apr 29, 2026

Summary

Updates Grid Visualizer to align with recent OpenAPI schema changes:

  • PKR_ACCOUNT: Add bankName field (required for MOBILE_MONEY rails per schema update)
  • Beneficiary generation: Add countryOfResidence field (now required for BDT, GHS, HTG, JMD, PKR currencies)

Context

Recent schema syncs in #418 and #416 changed field requirements:

  • bankName removed as required from most currencies, but remains needed for PKR MOBILE_MONEY
  • countryOfResidence added as required for several beneficiary schemas

Changes

File Change
account-types.ts Add bankName to PKR_ACCOUNT fields
code-generator.ts Include countryOfResidence in generated beneficiary

Test plan

  • Grid Visualizer builds successfully
  • Generated API examples for PKR include bankName
  • Generated beneficiaries include countryOfResidence

🤖 Generated with Claude Code

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>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
grid-flow-builder Ready Ready Preview, Comment Apr 29, 2026 8:54am

Request Review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 29, 2026

Greptile Summary

Syncs the Grid Visualizer with recent OpenAPI schema changes from PRs #416 and #418: adds bankName to the PKR_ACCOUNT field spec and includes countryOfResidence in the generated beneficiary object for currencies that now require it.

Confidence Score: 4/5

Safe 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 nationality as countryOfResidence in generated examples) keeps the score at 4.

code-generator.ts — minor semantic imprecision in how countryOfResidence is populated.

Important Files Changed

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)"]
Loading

Fix All in Claude Code

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,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Fix in Claude Code

@pengying pengying merged commit a16a356 into main Apr 30, 2026
8 checks passed
@pengying pengying deleted the docs/sync-20260429 branch April 30, 2026 21:07
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