Skip to content

Add support for MWK, UGX, and XOF currency accounts#240

Merged
matthappens merged 4 commits intomainfrom
claude/add-yellowcard-accounts-fL7tG
Mar 3, 2026
Merged

Add support for MWK, UGX, and XOF currency accounts#240
matthappens merged 4 commits intomainfrom
claude/add-yellowcard-accounts-fL7tG

Conversation

@matthappens
Copy link
Contributor

Summary

This PR adds OpenAPI schema definitions for three new currency account types: Malawian Kwacha (MWK), Ugandan Shilling (UGX), and West African CFA Franc (XOF). Each currency includes mobile money payment rail support with region-specific phone number validation and provider configurations.

Key Changes

  • MWK Account Support: Added schemas for Malawian mobile money accounts supporting Airtel and TNM providers with phone number validation pattern ^\+265[0-9]{9}$
  • UGX Account Support: Added schemas for Ugandan mobile money accounts supporting MTN and Airtel providers with phone number validation pattern ^\+256[0-9]{9}$
  • XOF Account Support: Added schemas for West African mobile money accounts (Senegal, Benin, Ivory Coast) supporting MTN, Orange, Wave, Moov, and Free providers with multi-country phone validation pattern ^\+(221|225|229)[0-9]{8,10}$
  • Updated ExternalAccountType enum to include MWK_ACCOUNT, UGX_ACCOUNT, and XOF_ACCOUNT
  • Updated ExternalAccountInfoOneOf discriminator mapping to route new account types to their respective schemas
  • Created modular YAML schema files for account info, beneficiary, and external account info definitions for each currency

Implementation Details

  • Each currency follows the established pattern with AccountInfo, Beneficiary, and ExternalAccountInfo schema components
  • All three currencies use MOBILE_MONEY as the sole payment rail
  • Beneficiary schemas support both INDIVIDUAL and BUSINESS beneficiary types with discriminator-based routing
  • Phone number patterns are region-specific to ensure valid formatting for each country/provider combination

https://claude.ai/code/session_01QxLc91riHT65xhDy4z7Gdt

claude added 2 commits March 3, 2026 00:19
…wi, and Uganda

- XOF_ACCOUNT: covers Senegal (SN), Benin (BJ), and Ivory Coast (CI) via mobile money
  with providers MTN, ORANGE, WAVE, MOOV, FREE
- MWK_ACCOUNT: Malawi (MW) mobile money with providers AIRTEL and TNM
- UGX_ACCOUNT: Uganda (UG) mobile money with providers MTN and AIRTEL

Follows the same pattern as the African currency accounts added in cf847f6.

https://claude.ai/code/session_01QxLc91riHT65xhDy4z7Gdt
- RWF: MTN → MTN_Rwanda (removed AIRTEL)
- TZS: AIRTEL/VODACOM → AIRTELMONEYTZ, TIGO, HALOPESA
- ZMW: TNM/AIRTEL/ZAMTEL/MTN → MTN, TNM, Airtel (removed ZAMTEL)
- XOF (Senegal/Benin/Ivory Coast): replace generic enums with correct
  provider strings per country: Wave, Free, Free Money, Orange Money,
  Moov, Mtn Mobile Money BJ, Orange, MTN, Moov money, Mtn Mobile Money
- MWK: AIRTEL → Airtel

https://claude.ai/code/session_01QxLc91riHT65xhDy4z7Gdt
@matthappens matthappens marked this pull request as ready for review March 3, 2026 00:28
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

✱ Stainless preview builds

This PR will update the grid SDKs with the following commit messages.

kotlin

feat: Add support for MWK, UGX, and XOF currency accounts

openapi

feat: Add support for MWK, UGX, and XOF currency accounts

python

feat: Add support for MWK, UGX, and XOF currency accounts

typescript

feat(api): add MWK/UGX/XOF account types, update RWF/TZS/ZMW providers in external accounts
grid-openapi studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅

grid-python studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ✅lint ✅test ✅

pip install https://pkg.stainless.com/s/grid-python/b98a84d0a03e8b22efd4dda2257ef164c8737f6b/grid-0.0.1-py3-none-any.whl
⚠️ grid-kotlin studio · code

Your SDK build had a failure in the build CI job, which is a regression from the base state.
generate ✅build ❗lint ✅test ❗

grid-typescript studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ✅lint ✅test ✅

npm install https://pkg.stainless.com/s/grid-typescript/155de31295bb684078c264a27b37b6da5cd8ce4c/dist.tar.gz

This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-03-03 18:29:17 UTC

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 3, 2026

Greptile Summary

This PR adds OpenAPI schema support for three new mobile money currency accounts — MWK (Malawi), UGX (Uganda), and XOF (West African CFA Franc / Senegal, Benin, Ivory Coast) — following the existing modular pattern with AccountInfo, Beneficiary, and ExternalAccountInfo components.

Key changes:

  • Added MwkAccountInfo, UgxAccountInfo, XofAccountInfo schemas with MOBILE_MONEY payment rail and region-specific phone validation patterns
  • Added corresponding MwkBeneficiary, UgxBeneficiary, XofBeneficiary schemas (INDIVIDUAL + BUSINESS discriminator)
  • Added MwkExternalAccountInfo, UgxExternalAccountInfo, XofExternalAccountInfo schemas composing the above
  • Registered all three in ExternalAccountType, ExternalAccountInfoOneOf, and the discriminator mapping
  • Updated openapi.yaml and mintlify/openapi.yaml (the compiled files) to include all additions

Issue found:

  • The XOF phone validation pattern in the compiled openapi.yaml / mintlify/openapi.yaml (^\+(221|225|229)[0-9]{8,10}$) differs from the source XofAccountInfo.yaml (^\+(221[0-9]{9}|225[0-9]{10}|229[0-9]{8,9})$). The compiled files appear to have been generated before the source file was updated with the per-country pattern, meaning the more precise validation will not be enforced against API requests until the compiled files are regenerated.

Confidence Score: 2/5

  • MWK and UGX are correctly implemented, but XOF phone validation will be under-constrained until the compiled files are regenerated from source.
  • The MWK and UGX additions are correct and follow established patterns. However, the compiled openapi.yaml and mintlify/openapi.yaml contain a looser XOF phone regex than what the source XofAccountInfo.yaml defines. Since API consumers read the compiled files directly, invalid phone numbers for Senegal, Ivory Coast, and Benin will pass schema validation until the compiled files are regenerated to match the source.
  • openapi.yaml and mintlify/openapi.yaml — the XOF phone pattern needs to match the per-country regex in openapi/components/schemas/common/XofAccountInfo.yaml.

Last reviewed commit: 6846928

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

17 files reviewed, 5 comments

Edit Code Review Agent Settings | Greptile

…unts

Provider values are driven by a third-party and change frequently,
so an enum on the API surface is impractical. Affects KES, RWF, TZS,
ZMW, XOF, MWK, and UGX account schemas.

https://claude.ai/code/session_01QxLc91riHT65xhDy4z7Gdt
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
type: string
description: West African mobile money phone number (Senegal, Benin, or Ivory Coast)
example: '+221781234567'
pattern: ^\+(221|225|229)[0-9]{8,10}$
Copy link
Contributor

Choose a reason for hiding this comment

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

XOF phone pattern mismatch between source and compiled files

The compiled openapi.yaml (and mintlify/openapi.yaml) contains the looser pattern:

^\+(221|225|229)[0-9]{8,10}$

However, the source file openapi/components/schemas/common/XofAccountInfo.yaml (line 31) contains the more precise per-country pattern:

^\+(221[0-9]{9}|225[0-9]{10}|229[0-9]{8,9})$

The compiled files are out of sync with the source. Since API consumers read openapi.yaml directly, the less-precise pattern is what will actually be enforced at validation time. The looser pattern incorrectly accepts:

  • Senegal (+221) with 8 or 10 digits (should be exactly 9)
  • Ivory Coast (+225) with 8 or 9 digits (should be exactly 10)
  • Benin (+229) with 10 digits (should be 8 or 9)

The compiled files need to be regenerated from the updated source to enforce the per-country digit counts. The same discrepancy exists in mintlify/openapi.yaml at the equivalent line.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi.yaml
Line: 6888

Comment:
**XOF phone pattern mismatch between source and compiled files**

The compiled `openapi.yaml` (and `mintlify/openapi.yaml`) contains the looser pattern:
```
^\+(221|225|229)[0-9]{8,10}$
```

However, the source file `openapi/components/schemas/common/XofAccountInfo.yaml` (line 31) contains the more precise per-country pattern:
```
^\+(221[0-9]{9}|225[0-9]{10}|229[0-9]{8,9})$
```

The compiled files are out of sync with the source. Since API consumers read `openapi.yaml` directly, the less-precise pattern is what will actually be enforced at validation time. The looser pattern incorrectly accepts:
- Senegal (`+221`) with 8 or 10 digits (should be exactly 9)
- Ivory Coast (`+225`) with 8 or 9 digits (should be exactly 10)
- Benin (`+229`) with 10 digits (should be 8 or 9)

The compiled files need to be regenerated from the updated source to enforce the per-country digit counts. The same discrepancy exists in `mintlify/openapi.yaml` at the equivalent line.

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

Copy link
Contributor

Choose a reason for hiding this comment

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

this seems right

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah shucks, I even fixed it to this

@matthappens matthappens merged commit a292f0b into main Mar 3, 2026
7 of 8 checks passed
@matthappens matthappens deleted the claude/add-yellowcard-accounts-fL7tG branch March 3, 2026 18:24
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.

3 participants