Add SLV_ACCOUNT external-account type for El Salvador#462
Conversation
The Thunes destination resolver already maps SLV_ACCOUNT → $grid.slv in sparkcore, but there was no OpenAPI schema for clients to create SLV accounts with. Add it now so we can unblock end-to-end testing of the El Salvador corridor. SLV runs on USD but is a distinct payout corridor from Lightspark's US bank flow (which uses USD_ACCOUNT). Modeled as a separate accountType under the same USD currency so the existing US flow is untouched and disambiguation happens at the destination-resolution layer, not at the currency layer. Schemas mirror the recent GHS/BDT shape: per-rail-conditional required fields (bankAccountType + accountNumber for BANK_TRANSFER, phoneNumber for MOBILE_MONEY/Tigo Money). Beneficiary follows the existing Thunes-corridor pattern. Files: - common/SlvAccountInfoBase.yaml — multi-rail base fields - common/SlvAccountInfo.yaml — adds paymentRails for response shape - common/SlvBeneficiary.yaml — Individual beneficiary, INDIVIDUAL discriminator - common/PaymentSlvAccountInfo.yaml — payment-instruction variant - external_accounts/SlvExternalAccountCreateInfo.yaml — create payload - external_accounts/SlvExternalAccountInfo.yaml — response payload - ExternalAccountType.yaml — add SLV_ACCOUNT enum value - ExternalAccountCreateInfoOneOf.yaml — register in create discriminator - ExternalAccountInfoOneOf.yaml — register in response discriminator - PaymentInstructions.yaml — register in payment discriminator
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✱ Stainless preview builds for gridThis PR will update the kotlin openapi python typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-python studio · code · diff
⏳ grid-kotlin studio · code · diff
✅ grid-openapi studio · code · diff
✅ grid-typescript studio · code · diff
⏳ These are partial results; builds are still running. This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
|
Superseded by fresh branch with cleaner name; reopening as draft. |
Greptile SummaryThis PR introduces
Confidence Score: 5/5Safe to merge — pure schema additions with no changes to existing account types or flows. All six new schema files faithfully mirror the GHS/BDT/HTG corridor pattern: the create schema uses the base (no paymentRails), the response schema uses the enriched shape (with paymentRails), the discriminator mappings are complete in all four registries, and the phone-number regex and El Salvador country-code example are correct. No existing schema is modified beyond appending one entry to each list/mapping. No files require special attention.
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/common/SlvAccountInfoBase.yaml | Core SLV account fields — bankName/accountNumber/bankAccountType for BANK_TRANSFER, phoneNumber for MOBILE_MONEY; mirrors GHS/BDT pattern, phone pattern and El Salvador country-code example are correct |
| openapi/components/schemas/common/SlvAccountInfo.yaml | Adds required paymentRails array to the base for the response shape; consistent with GhsAccountInfo.yaml |
| openapi/components/schemas/common/SlvBeneficiary.yaml | Individual beneficiary schema — identical structure to GhsBeneficiary/BdtBeneficiary/HtgBeneficiary, following the established per-corridor pattern |
| openapi/components/schemas/common/PaymentSlvAccountInfo.yaml | Payment-instruction variant composing BasePaymentAccountInfo + SlvAccountInfo + required reference field; mirrors PaymentGhsAccountInfo exactly |
| openapi/components/schemas/external_accounts/SlvExternalAccountCreateInfo.yaml | Create-request body composing BaseExternalAccountInfo + SlvAccountInfoBase (no paymentRails, consistent with other create schemas) + required beneficiary discriminator |
| openapi/components/schemas/external_accounts/SlvExternalAccountInfo.yaml | Response shape composing BaseExternalAccountInfo + SlvAccountInfo (includes paymentRails) + required beneficiary discriminator |
| openapi/components/schemas/external_accounts/ExternalAccountType.yaml | SLV_ACCOUNT enum value added after PKR_ACCOUNT, maintaining alphabetical ordering |
| openapi/components/schemas/external_accounts/ExternalAccountCreateInfoOneOf.yaml | SLV_ACCOUNT added to both oneOf list and discriminator mapping — wiring is complete and correct |
| openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml | SLV_ACCOUNT added to both oneOf list and discriminator mapping — wiring is complete and correct |
| openapi/components/schemas/common/PaymentInstructions.yaml | SLV_ACCOUNT added to oneOf list and discriminator mapping; insertion between PKR and EMBEDDED_WALLET is consistent with ordering in other discriminator files |
Class Diagram
%%{init: {'theme': 'neutral'}}%%
classDiagram
class SlvAccountInfoBase {
+accountType: SLV_ACCOUNT
+bankName: string
+accountNumber: string
+bankAccountType: CHECKING|SAVINGS
+phoneNumber: string
}
class SlvAccountInfo {
+paymentRails: array
}
class SlvExternalAccountCreateInfo {
+beneficiary: SlvBeneficiary|BusinessBeneficiary
}
class SlvExternalAccountInfo {
+beneficiary: SlvBeneficiary|BusinessBeneficiary
}
class PaymentSlvAccountInfo {
+reference: string
}
class BaseExternalAccountInfo
class BasePaymentAccountInfo
SlvAccountInfo --|> SlvAccountInfoBase : allOf
SlvExternalAccountCreateInfo --|> BaseExternalAccountInfo : allOf
SlvExternalAccountCreateInfo --|> SlvAccountInfoBase : allOf
SlvExternalAccountInfo --|> BaseExternalAccountInfo : allOf
SlvExternalAccountInfo --|> SlvAccountInfo : allOf
PaymentSlvAccountInfo --|> BasePaymentAccountInfo : allOf
PaymentSlvAccountInfo --|> SlvAccountInfo : allOf
Reviews (1): Last reviewed commit: "Add SLV_ACCOUNT external-account type fo..." | Re-trigger Greptile
Summary
Adds the OpenAPI schemas for `SLV_ACCOUNT`, the external-account type for El Salvador Thunes payouts. The sparkcore destination resolver at thunes_destination_resolver.py:30 already maps `SLV_ACCOUNT → $grid.slv`, but until now there was no schema for clients to create such accounts. This is the foundation needed before we can wire SLV in sparkcore and finally turn the corridor on for testing.
Design notes
El Salvador uses USD as its currency, which Lightspark also uses for the US bank corridor. To avoid touching the existing US flow, `SLV_ACCOUNT` is modeled as a separate `accountType` under the same `USD` currency. The dispatch on accountType is what distinguishes routes:
No new `CurrencyUnit` is introduced, no schema for US bank flow is modified.
Schema layout
Mirrors the recent GHS/BDT refactor (per-rail conditional fields):
Bundled `openapi.yaml` regenerated via `npm run build:openapi`; mintlify copy updated.
Test plan
Follow-up
Sparkcore PR will:
🤖 Generated with Claude Code