Skip to content

chore: Sync account schemas#299

Open
lightspark-copybara[bot] wants to merge 1 commit intomainfrom
auto/sync-grid-schemas-20260326-190907
Open

chore: Sync account schemas#299
lightspark-copybara[bot] wants to merge 1 commit intomainfrom
auto/sync-grid-schemas-20260326-190907

Conversation

@lightspark-copybara
Copy link
Copy Markdown
Contributor

Auto-synced account schemas.

These schemas are generated from VASP adapter field definitions in sparkcore.

Synced schemas:

  • common/ — per-currency account info, beneficiary, and payment account schemas
  • common/PaymentInstructions.yaml — payment instructions oneOf (new currencies added)
  • external_accounts/ — per-currency external account schemas (reference common/)

Please review the changes before merging.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 26, 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 Mar 26, 2026 7:09pm

Request Review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 26, 2026

Greptile Summary

This PR syncs auto-generated account schemas from VASP adapter field definitions in sparkcore, adding support for 8 new currencies: BDT (Bangladeshi Taka), COP (Colombian Peso), EGP (Egyptian Pound), GHS (Ghanaian Cedi), GTQ (Guatemalan Quetzal), HTG (Haitian Gourde), JMD (Jamaican Dollar), and PKR (Pakistani Rupee). Each currency gets a consistent set of schemas: AccountInfo, Beneficiary, PaymentAccountInfo, and ExternalAccountInfo. Additionally, UsdAccountInfo gains a BANK_TRANSFER rail and UsdBeneficiary relaxes its required fields.\n\n- 36 files changed: 34 new schema files added for 8 new currencies, plus updates to PaymentInstructions.yaml, ExternalAccountInfoOneOf.yaml, UsdAccountInfo.yaml, and UsdBeneficiary.yaml\n- ExternalAccountInfoOneOf.yaml: The new LIGHTNING_ACCOUNT: ./LightningExternalAccountInfo.yaml discriminator entry is inconsistent — the Lightning schema's accountType enum value is LIGHTNING (not LIGHTNING_ACCOUNT), and a correct LIGHTNING mapping already exists. This spurious entry should be removed.\n- IBAN examples: Both EgpAccountInfo.yaml and PkrAccountInfo.yaml use a German IBAN (DE89370400440532013000) as the example value, which could mislead developers integrating with Egyptian or Pakistani banking.\n- All new currency schemas follow the established pattern (allOf composition with BaseExternalAccountInfo / BasePaymentAccountInfo, INDIVIDUAL/BUSINESS beneficiary discriminator) consistently.

Confidence Score: 4/5

Safe to merge after removing the erroneous LIGHTNING_ACCOUNT discriminator mapping; all other schema additions are consistent and well-structured.

The 34 new currency schema files are well-formed and follow the existing patterns exactly. The only concrete issue is the incorrect LIGHTNING_ACCOUNT discriminator key in ExternalAccountInfoOneOf.yaml — it routes to a schema whose enum only accepts LIGHTNING, creating an unresolvable validation dead-end for that key. This is a targeted, one-line fix. The IBAN example concern is P2/style only.

openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml — needs the erroneous LIGHTNING_ACCOUNT discriminator mapping removed.

Important Files Changed

Filename Overview
openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml Adds 8 new currency entries to the oneOf list and discriminator mapping, but also incorrectly adds a duplicate LIGHTNING_ACCOUNT discriminator key that conflicts with the existing LIGHTNING mapping for the same schema.
openapi/components/schemas/common/PaymentInstructions.yaml Adds 8 new currency entries (BDT, COP, EGP, GHS, GTQ, HTG, JMD, PKR) to both the oneOf list and the discriminator mapping; no issues found.
openapi/components/schemas/common/UsdBeneficiary.yaml Removes birthDate and nationality from the required fields list, making them optional — a backward-compatible relaxation of the schema.
openapi/components/schemas/common/UsdAccountInfo.yaml Adds BANK_TRANSFER as a valid enum value for paymentRails, extending USD account support; additive change with no issues.
openapi/components/schemas/common/EgpAccountInfo.yaml New EGP account schema with IBAN and SWIFT support; the IBAN example uses a German IBAN (DE...) which is misleading for an Egyptian currency schema.
openapi/components/schemas/common/PkrAccountInfo.yaml New PKR account schema with IBAN support; the IBAN example uses a German IBAN (DE...) rather than a PKR-appropriate example.
openapi/components/schemas/common/BdtAccountInfo.yaml New BDT account schema with BANK_TRANSFER and MOBILE_MONEY rails, branch code, SWIFT, and phone number; looks correct.
openapi/components/schemas/common/HtgAccountInfo.yaml New HTG account schema with only MOBILE_MONEY rail and phone number (no bank account fields), consistent with mobile money-only market.
openapi/components/schemas/external_accounts/BdtExternalAccountInfo.yaml New BDT external account composing BaseExternalAccountInfo + BdtAccountInfo with a required beneficiary (INDIVIDUAL/BUSINESS); pattern is consistent with all other currency external account schemas.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    EAOneOf["ExternalAccountInfoOneOf\n(oneOf discriminator)"] --> BDT["BdtExternalAccountInfo\n(BDT_ACCOUNT)"]
    EAOneOf --> COP["CopExternalAccountInfo\n(COP_ACCOUNT)"]
    EAOneOf --> EGP["EgpExternalAccountInfo\n(EGP_ACCOUNT)"]
    EAOneOf --> GHS["GhsExternalAccountInfo\n(GHS_ACCOUNT)"]
    EAOneOf --> GTQ["GtqExternalAccountInfo\n(GTQ_ACCOUNT)"]
    EAOneOf --> HTG["HtgExternalAccountInfo\n(HTG_ACCOUNT)"]
    EAOneOf --> JMD["JmdExternalAccountInfo\n(JMD_ACCOUNT)"]
    EAOneOf --> PKR["PkrExternalAccountInfo\n(PKR_ACCOUNT)"]
    BDT --> BdtAI["BdtAccountInfo\n(accountNumber, branchCode,\nswiftCode, phoneNumber)"]
    BDT --> BdtB["BdtBeneficiary\nor BusinessBeneficiary"]
    EAOneOf -. "LIGHTNING_ACCOUNT key\nshould not exist" .-> Lightning["LightningExternalAccountInfo\naccountType enum = LIGHTNING"]
    PI["PaymentInstructions\n(oneOf discriminator)"] --> PBDT["PaymentBdtAccountInfo"]
    PI --> PCOP["PaymentCopAccountInfo"]
    PI --> PEGP["PaymentEgpAccountInfo"]
    PI --> PGHS["PaymentGhsAccountInfo"]
    PI --> PGTQ["PaymentGtqAccountInfo"]
    PI --> PHTG["PaymentHtgAccountInfo"]
    PI --> PJMD["PaymentJmdAccountInfo"]
    PI --> PPKR["PaymentPkrAccountInfo"]
    PBDT --> Base["BasePaymentAccountInfo\n(reference)"]
    PBDT --> BdtAI
Loading

Comments Outside Diff (1)

  1. openapi/components/schemas/common/EgpAccountInfo.yaml, line 203 (link)

    P2 Misleading IBAN example for non-European currency

    The iban field uses DE89370400440532013000 (a German IBAN) as the example value. Egyptian IBANs begin with EG and are 27 characters long, while German IBANs are 22 characters. Using a German IBAN as the example may mislead API consumers integrating with Egyptian banking systems.

    The same issue exists in PkrAccountInfo.yaml — the IBAN example is also a German IBAN (DE89370400440532013000) even though Pakistani IBANs start with PK and are 24 characters long.

    Consider using country-appropriate example values:

    • EGP: EG380019000500000000263180002 (Egyptian IBAN format)
    • PKR: PK36SCBL0000001123456702 (Pakistani IBAN format)
    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: openapi/components/schemas/common/EgpAccountInfo.yaml
    Line: 203
    
    Comment:
    **Misleading IBAN example for non-European currency**
    
    The `iban` field uses `DE89370400440532013000` (a German IBAN) as the example value. Egyptian IBANs begin with `EG` and are 27 characters long, while German IBANs are 22 characters. Using a German IBAN as the example may mislead API consumers integrating with Egyptian banking systems.
    
    The same issue exists in `PkrAccountInfo.yaml` — the IBAN example is also a German IBAN (`DE89370400440532013000`) even though Pakistani IBANs start with `PK` and are 24 characters long.
    
    Consider using country-appropriate example values:
    - EGP: `EG380019000500000000263180002` (Egyptian IBAN format)
    - PKR: `PK36SCBL0000001123456702` (Pakistani IBAN format)
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml
Line: 88

Comment:
**Incorrect `LIGHTNING_ACCOUNT` discriminator key for Lightning schema**

This PR adds `LIGHTNING_ACCOUNT: ./LightningExternalAccountInfo.yaml` to the discriminator mapping, but that key doesn't match the actual `accountType` enum value in `LightningInfo.yaml`, which is `LIGHTNING`. The correct discriminator entry (`LIGHTNING: ./LightningExternalAccountInfo.yaml`) is already present at line 72.

Having both `LIGHTNING` and `LIGHTNING_ACCOUNT` pointing to the same file means that a payload arriving with `accountType: LIGHTNING_ACCOUNT` will be routed to `LightningExternalAccountInfo.yaml` by the discriminator, but then fail schema validation immediately because the Lightning schema only permits `accountType: LIGHTNING` (enum constraint). This creates a confusing, unresolvable validation failure for consumers using that discriminator key.

The `LIGHTNING_ACCOUNT` entry should be removed from the mapping. It appears to have been accidentally included as part of the batch addition for the new currency schemas (BDT, COP, EGP, GHS, GTQ, HTG, JMD, PKR).

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: openapi/components/schemas/common/EgpAccountInfo.yaml
Line: 203

Comment:
**Misleading IBAN example for non-European currency**

The `iban` field uses `DE89370400440532013000` (a German IBAN) as the example value. Egyptian IBANs begin with `EG` and are 27 characters long, while German IBANs are 22 characters. Using a German IBAN as the example may mislead API consumers integrating with Egyptian banking systems.

The same issue exists in `PkrAccountInfo.yaml` — the IBAN example is also a German IBAN (`DE89370400440532013000`) even though Pakistani IBANs start with `PK` and are 24 characters long.

Consider using country-appropriate example values:
- EGP: `EG380019000500000000263180002` (Egyptian IBAN format)
- PKR: `PK36SCBL0000001123456702` (Pakistani IBAN format)

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "chore: Sync account schemas" | Re-trigger Greptile

GTQ_ACCOUNT: ./GtqExternalAccountInfo.yaml
HTG_ACCOUNT: ./HtgExternalAccountInfo.yaml
JMD_ACCOUNT: ./JmdExternalAccountInfo.yaml
LIGHTNING_ACCOUNT: ./LightningExternalAccountInfo.yaml
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.

P1 Incorrect LIGHTNING_ACCOUNT discriminator key for Lightning schema

This PR adds LIGHTNING_ACCOUNT: ./LightningExternalAccountInfo.yaml to the discriminator mapping, but that key doesn't match the actual accountType enum value in LightningInfo.yaml, which is LIGHTNING. The correct discriminator entry (LIGHTNING: ./LightningExternalAccountInfo.yaml) is already present at line 72.

Having both LIGHTNING and LIGHTNING_ACCOUNT pointing to the same file means that a payload arriving with accountType: LIGHTNING_ACCOUNT will be routed to LightningExternalAccountInfo.yaml by the discriminator, but then fail schema validation immediately because the Lightning schema only permits accountType: LIGHTNING (enum constraint). This creates a confusing, unresolvable validation failure for consumers using that discriminator key.

The LIGHTNING_ACCOUNT entry should be removed from the mapping. It appears to have been accidentally included as part of the batch addition for the new currency schemas (BDT, COP, EGP, GHS, GTQ, HTG, JMD, PKR).

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml
Line: 88

Comment:
**Incorrect `LIGHTNING_ACCOUNT` discriminator key for Lightning schema**

This PR adds `LIGHTNING_ACCOUNT: ./LightningExternalAccountInfo.yaml` to the discriminator mapping, but that key doesn't match the actual `accountType` enum value in `LightningInfo.yaml`, which is `LIGHTNING`. The correct discriminator entry (`LIGHTNING: ./LightningExternalAccountInfo.yaml`) is already present at line 72.

Having both `LIGHTNING` and `LIGHTNING_ACCOUNT` pointing to the same file means that a payload arriving with `accountType: LIGHTNING_ACCOUNT` will be routed to `LightningExternalAccountInfo.yaml` by the discriminator, but then fail schema validation immediately because the Lightning schema only permits `accountType: LIGHTNING` (enum constraint). This creates a confusing, unresolvable validation failure for consumers using that discriminator key.

The `LIGHTNING_ACCOUNT` entry should be removed from the mapping. It appears to have been accidentally included as part of the batch addition for the new currency schemas (BDT, COP, EGP, GHS, GTQ, HTG, JMD, PKR).

How can I resolve this? If you propose a fix, please make it concise.

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.

0 participants