Skip to content

chore: Sync account schemas#290

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

chore: Sync account schemas#290
lightspark-copybara[bot] wants to merge 1 commit intomainfrom
auto/sync-grid-schemas-20260323-225724

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 23, 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 23, 2026 10:58pm

Request Review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 23, 2026

Greptile Summary

This PR auto-syncs account schemas generated from VASP adapter field definitions in sparkcore, adding support for 8 new currencies (BDT, COP, EGP, GHS, GTQ, HTG, JMD, PKR) across common/ and external_accounts/ schema directories, and updating PaymentInstructions.yaml and ExternalAccountInfoOneOf.yaml to include the new entries.

  • New *AccountInfo.yaml, *Beneficiary.yaml, Payment*AccountInfo.yaml, and *ExternalAccountInfo.yaml schemas added for each currency, following the established allOf pattern
  • UsdAccountInfo.yaml gains BANK_TRANSFER as an additional payment rail
  • UsdBeneficiary.yaml relaxes birthDate and nationality from required to optional, aligning with the other currency beneficiary schemas
  • Bug: ExternalAccountInfoOneOf.yaml introduces a spurious LIGHTNING_ACCOUNT: ./LightningExternalAccountInfo.yaml discriminator mapping entry that has no corresponding oneOf reference and duplicates the existing LIGHTNING mapping — this should be removed
  • Minor: EgpAccountInfo.yaml and PkrAccountInfo.yaml use a German IBAN (DE89…) as the example value for their iban fields, which could mislead integrators

Confidence Score: 4/5

  • Safe to merge after removing the spurious LIGHTNING_ACCOUNT discriminator entry in ExternalAccountInfoOneOf.yaml.
  • The PR is a straightforward schema sync that follows well-established patterns used throughout the codebase. The one concrete bug — the LIGHTNING_ACCOUNT orphaned discriminator entry — should be fixed before merging as it can confuse OpenAPI tooling that validates discriminator/oneOf consistency, but it doesn't affect any of the newly added currency schemas. Everything else looks correct and consistent.
  • openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml — contains the spurious LIGHTNING_ACCOUNT discriminator entry.

Important Files Changed

Filename Overview
openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml Updated to add 8 new currency oneOf entries and discriminator mappings; contains a spurious LIGHTNING_ACCOUNT duplicate discriminator entry not backed by any oneOf reference.
openapi/components/schemas/common/PaymentInstructions.yaml Correctly adds 8 new currency account infos (BDT, COP, EGP, GHS, GTQ, HTG, JMD, PKR) to both the oneOf list and discriminator mapping; no issues found.
openapi/components/schemas/common/UsdBeneficiary.yaml Removes birthDate and nationality from required fields, aligning USD beneficiary with the other currency beneficiary schemas that only require beneficiaryType and fullName.
openapi/components/schemas/common/UsdAccountInfo.yaml Adds BANK_TRANSFER as a new valid payment rail enum value for USD accounts; consistent with other account schemas.
openapi/components/schemas/common/BdtAccountInfo.yaml New BDT account schema with accountNumber, branchCode, phoneNumber required; supports BANK_TRANSFER and MOBILE_MONEY rails; well-structured.
openapi/components/schemas/common/EgpAccountInfo.yaml New EGP account schema; the optional iban field uses a German IBAN example (DE prefix) which is misleading for Egyptian accounts.
openapi/components/schemas/common/PkrAccountInfo.yaml New PKR account schema; the optional iban field also uses a German IBAN example (DE prefix) which is misleading for Pakistani accounts.
openapi/components/schemas/external_accounts/BdtExternalAccountInfo.yaml New BDT external account schema following established allOf pattern with BaseExternalAccountInfo, BdtAccountInfo, and beneficiary discriminator; looks correct.
openapi/components/schemas/common/HtgAccountInfo.yaml New HTG (Haitian Gourde) account schema; notably only supports MOBILE_MONEY rail (no BANK_TRANSFER) and does not require accountNumber, reflecting the mobile-money-only nature of HTG transfers.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    PI[PaymentInstructions.yaml\noneOf / 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] & BDT[BdtAccountInfo]
    PCOP --> BASE & COP[CopAccountInfo]
    PEGP --> BASE & EGP[EgpAccountInfo]
    PGHS --> BASE & GHS[GhsAccountInfo]
    PGTQ --> BASE & GTQ[GtqAccountInfo]
    PHTG --> BASE & HTG[HtgAccountInfo]
    PJMD --> BASE & JMD[JmdAccountInfo]
    PPKR --> BASE & PKR[PkrAccountInfo]

    EXT[ExternalAccountInfoOneOf.yaml\noneOf / discriminator] --> EBDT[BdtExternalAccountInfo]
    EXT --> ECOP[CopExternalAccountInfo]
    EXT --> EEGP[EgpExternalAccountInfo]
    EXT --> EGHS[GhsExternalAccountInfo]
    EXT --> EGTQ[GtqExternalAccountInfo]
    EXT --> EHTG[HtgExternalAccountInfo]
    EXT --> EJMD[JmdExternalAccountInfo]
    EXT --> EPKR[PkrExternalAccountInfo]

    EBDT --> BASEXT[BaseExternalAccountInfo] & BDT
    ECOP --> BASEXT & COP
    EEGP --> BASEXT & EGP
    EGHS --> BASEXT & GHS
    EGTQ --> BASEXT & GTQ
    EHTG --> BASEXT & HTG
    EJMD --> BASEXT & JMD
    EPKR --> BASEXT & PKR

    EBDT -->|beneficiary oneOf| BDTBEN[BdtBeneficiary / BusinessBeneficiary]
    ECOP -->|beneficiary oneOf| COPBEN[CopBeneficiary / BusinessBeneficiary]

    style EXT fill:#ffd6d6,stroke:#c00
Loading
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:
**Spurious `LIGHTNING_ACCOUNT` discriminator entry**

This PR adds `LIGHTNING_ACCOUNT: ./LightningExternalAccountInfo.yaml` to the discriminator mapping, but:
1. There is no corresponding `oneOf` entry added for `LIGHTNING_ACCOUNT` in this PR (or in the original file).
2. `LIGHTNING` is already present as a discriminator mapping key pointing to the same file (`./LightningExternalAccountInfo.yaml`) at line 72 of the current file.

This creates a duplicate/orphaned discriminator entry that does not correspond to any `accountType` enum value (which is `LIGHTNING`, not `LIGHTNING_ACCOUNT`) and is not backed by a `oneOf` schema reference. It may cause unexpected behavior for OpenAPI tooling that validates discriminator consistency.

```suggestion
    JMD_ACCOUNT: ./JmdExternalAccountInfo.yaml
    PKR_ACCOUNT: ./PkrExternalAccountInfo.yaml
```

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: 20

Comment:
**German IBAN example for Egyptian account schema**

The `iban` field example `DE89370400440532013000` is a German IBAN (prefix `DE`). For an Egyptian Pound (EGP) account, this example should use an Egyptian IBAN (prefix `EG`). While this is just an example and the `pattern` correctly validates any country's IBAN format, it may confuse API consumers integrating with EGP payment flows.

The same issue appears in `PkrAccountInfo.yaml` line 17, which also uses the German IBAN example despite being a Pakistani Rupee (PKR) account schema (Pakistan IBANs use `PK` prefix).

```suggestion
    example: EG800002000156789012345180002
```

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.

P2 Spurious LIGHTNING_ACCOUNT discriminator entry

This PR adds LIGHTNING_ACCOUNT: ./LightningExternalAccountInfo.yaml to the discriminator mapping, but:

  1. There is no corresponding oneOf entry added for LIGHTNING_ACCOUNT in this PR (or in the original file).
  2. LIGHTNING is already present as a discriminator mapping key pointing to the same file (./LightningExternalAccountInfo.yaml) at line 72 of the current file.

This creates a duplicate/orphaned discriminator entry that does not correspond to any accountType enum value (which is LIGHTNING, not LIGHTNING_ACCOUNT) and is not backed by a oneOf schema reference. It may cause unexpected behavior for OpenAPI tooling that validates discriminator consistency.

Suggested change
LIGHTNING_ACCOUNT: ./LightningExternalAccountInfo.yaml
JMD_ACCOUNT: ./JmdExternalAccountInfo.yaml
PKR_ACCOUNT: ./PkrExternalAccountInfo.yaml
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:
**Spurious `LIGHTNING_ACCOUNT` discriminator entry**

This PR adds `LIGHTNING_ACCOUNT: ./LightningExternalAccountInfo.yaml` to the discriminator mapping, but:
1. There is no corresponding `oneOf` entry added for `LIGHTNING_ACCOUNT` in this PR (or in the original file).
2. `LIGHTNING` is already present as a discriminator mapping key pointing to the same file (`./LightningExternalAccountInfo.yaml`) at line 72 of the current file.

This creates a duplicate/orphaned discriminator entry that does not correspond to any `accountType` enum value (which is `LIGHTNING`, not `LIGHTNING_ACCOUNT`) and is not backed by a `oneOf` schema reference. It may cause unexpected behavior for OpenAPI tooling that validates discriminator consistency.

```suggestion
    JMD_ACCOUNT: ./JmdExternalAccountInfo.yaml
    PKR_ACCOUNT: ./PkrExternalAccountInfo.yaml
```

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

accountNumber:
type: string
description: The account number of the bank
minLength: 1
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 German IBAN example for Egyptian account schema

The iban field example DE89370400440532013000 is a German IBAN (prefix DE). For an Egyptian Pound (EGP) account, this example should use an Egyptian IBAN (prefix EG). While this is just an example and the pattern correctly validates any country's IBAN format, it may confuse API consumers integrating with EGP payment flows.

The same issue appears in PkrAccountInfo.yaml line 17, which also uses the German IBAN example despite being a Pakistani Rupee (PKR) account schema (Pakistan IBANs use PK prefix).

Suggested change
minLength: 1
example: EG800002000156789012345180002
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/EgpAccountInfo.yaml
Line: 20

Comment:
**German IBAN example for Egyptian account schema**

The `iban` field example `DE89370400440532013000` is a German IBAN (prefix `DE`). For an Egyptian Pound (EGP) account, this example should use an Egyptian IBAN (prefix `EG`). While this is just an example and the `pattern` correctly validates any country's IBAN format, it may confuse API consumers integrating with EGP payment flows.

The same issue appears in `PkrAccountInfo.yaml` line 17, which also uses the German IBAN example despite being a Pakistani Rupee (PKR) account schema (Pakistan IBANs use `PK` prefix).

```suggestion
    example: EG800002000156789012345180002
```

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