Skip to content

feat: enforce Tanzania mobile number format validation with Tigo/Vodacom prefix checking#1133

Closed
zeroknowledge0x wants to merge 1 commit into
sublime247:mainfrom
zeroknowledge0x:fix/tanzania-phone-validation
Closed

feat: enforce Tanzania mobile number format validation with Tigo/Vodacom prefix checking#1133
zeroknowledge0x wants to merge 1 commit into
sublime247:mainfrom
zeroknowledge0x:fix/tanzania-phone-validation

Conversation

@zeroknowledge0x
Copy link
Copy Markdown

Fixes #1039

Summary

Implements Tanzania-specific mobile phone number validation with operator prefix checking for all major Tanzanian mobile network operators.

Changes

  • New Tanzania provider prefix mappings for 5 operators:
    • Vodacom: +25575, +25576, +25577, +25578
    • Tigo (Mixx by Yas): +25565, +25567, +25571
    • Airtel Tanzania: +25568, +25569
    • Halotel: +25562, +25563
    • TTCL: +25573
  • **** — validates E.164 format (+255XXXXXXXXX) and local format (0XXXXXXXXX), identifies operator
  • **** — validates phone number belongs to the expected provider's prefix band
  • Transaction controller integration — Tanzania numbers automatically route to Tanzania-specific validation
  • Comprehensive tests — 20+ test cases covering all operators, local format, and error scenarios

Testing

  • ✅ All Vodacom prefixes (075, 076, 077, 078) validated correctly
  • ✅ All Tigo prefixes (065, 067, 071) validated correctly
  • ✅ Airtel Tanzania prefixes (068, 069) validated correctly
  • ✅ Local format (0XXXXXXXXX) auto-normalized to E.164
  • ✅ Invalid prefixes rejected with descriptive error messages
  • ✅ Wrong-length numbers rejected with format guidance
  • ✅ Non-numeric characters rejected

Technical Details

  • Country code: +255
  • Number format: +255 + 9 digits (12 total) or 0 + 9 digits (10 total local)
  • Prefix validation ensures numbers belong to active Tanzania MNO allocations
  • Backward compatible — existing validation for other regions unchanged

@gitguardian
Copy link
Copy Markdown

gitguardian Bot commented May 30, 2026

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

…com prefix checking

- Add Tanzania provider prefix mappings (Vodacom, Tigo, Airtel, Halotel, TTCL)
- Add validateTanzaniaPhoneNumber() for E.164 and local format validation
- Add validateTanzaniaProviderMatch() for operator-aware provider matching
- Integrate Tanzania validation into transaction controller
- Add comprehensive tests for all Tanzania operators and error cases

Fixes sublime247#1039
@zeroknowledge0x zeroknowledge0x force-pushed the fix/tanzania-phone-validation branch from 178eb28 to 37148a7 Compare May 30, 2026 12:01
@sublime247 sublime247 closed this May 30, 2026
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.

[GOOD FIRST ISSUE] Enforce Mobile Number Format checks for Tanzania

3 participants