Skip to content

feat(i18n): add missing countries to catalog - #1590

Merged
khaira777 merged 7 commits into
mainfrom
feat/flocafe-missing-countries
Nov 15, 2026
Merged

khaira777 merged 7 commits into
mainfrom
feat/flocafe-missing-countries

Conversation

@khaira777

@khaira777 khaira777 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Check what other countries are missing from FloCafe's country selection catalog alongside Syria (SY) and add all missing valid countries and territories so users in every supported region can select their country, default timezone, currency, locale, and phone dial code cleanly.

Fixes #1585

What Changed

  • Added 113 missing ISO 3166-1 countries and territories (with BCP-47 locale, ISO 4217 currency, and IANA timezone defaults) to main/countries.ts, expanding the catalog to 245 country profiles across 153 currencies (100% of libphonenumber-js regions) and updating README.md to match.
  • Added SLE and XCG to SUPPLEMENTAL_ISO_CURRENCY_CODES in shared/currencies.ts, added 23 entries to NON_TWO_DECIMAL_COUNTRY_CURRENCIES in frontend/src/lib/cart-price.ts, and updated shared/print/currency.ts, shared/print/thermal-capabilities.ts, main/printers/formatting-helpers.ts, and frontend/src/lib/printer/ with сом./грн./Íkr ASCII fallbacks, letter-bounded token stripping (stripCurrencyTokens), and shared-glyph disambiguation (resolveAsciiCurrencyFallback for ¥, £, and ₩).
  • Expanded tests/country-profile.test.ts to verify locale, currency, decimal, timezone, E.164 dial code, display name, and libphonenumber-js coverage invariants for every catalog entry, and extended tests/currency-print-fallback.test.ts for Cyrillic token boundaries and shared-symbol thermal fallbacks.

Risk Assessment

✅ Low: The change cleanly expands the country catalog to 245 entries with valid locales, currencies, timezones, and dial codes, adds supplemental ICU currency codes (SLE, XCG) and word-bounded ASCII thermal fallbacks, and updates cart-price decimal mappings and README documentation.

Testing

Built the TypeScript backend and static Next.js frontend, passed all six targeted country/currency/phone/print test suites, and drove four live end-to-end scenarios (with screenshots and API transcripts saved to the evidence directory) covering setup search/selection, Store Details switching and persistence, +963 customer dial code and SYP POS/Orders/delivery-slip formatting, SL/SLE initialization, and adversarial invalid-input rejections before removing all transient build, dependency, and temp artifacts.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
First-run setup UI searches and selects newly added countries (SY/SYP, CW/XCG, SL/SLE, XK/EUR), populates default currency and timezone, and completes setup ✅ pass live ~/.no-mistakes/evidence/01M7GDY8V41EQR3ZSD3H6N0GNV/setup-syria-selected.png
Settings > Store Details lists all 245 countries/territories, updates default timezone, recommended currency, and phone dial code on switch, and persists across reload ✅ pass live ~/.no-mistakes/evidence/01M7GDY8V41EQR3ZSD3H6N0GNV/settings-syria-switched.png
Customers, POS, Orders, and delivery-slip payment formatting in newly added region (SY/SYP) normalize local +963 phone numbers and render SYP (ل.س.) rather than bare £ ✅ pass live ~/.no-mistakes/evidence/01M7GDY8V41EQR3ZSD3H6N0GNV/pos-sy-syp.png
Adversarial regional inputs are rejected by setup and settings endpoints while redenominated Sierra Leone (SL/SLE) initializes cleanly ✅ pass live ~/.no-mistakes/evidence/01M7GDY8V41EQR3ZSD3H6N0GNV/live-api-setup-adversarial.txt

Setup wizard country search and Syria (SY/SYP/Asia/Damascus) selection
Settings > Store Details hydrated with Curaçao (CW/XCG/America/Curacao/+599)
Settings > Store Details switched to Syria (SY/Asia/Damascus/+963)
Customers page showing +963 dial code normalization for Syria
POS screen displaying Syrian Pound (ل.س.) prices without collapsing to £
Orders screen displaying completed paid SYP order (‏٣٠٠ ل.س.‏)

Evidence: Live API transcript: SY setup, order/bill/payment, delivery slip, adversarial settings, and 9-country switching
[
  {
    "check": "login_SY",
    "status": 200
  },
  {
    "check": "paid_bill_SYP",
    "bill_id": 1,
    "total": 300,
    "paid_amount": 300,
    "payment_status": "paid"
  },
  {
    "check": "delivery_slip_payment_SYP",
    "status": 200,
    "payment": {
      "status": "paid",
      "method": "cash",
      "amount": 300,
      "amountDue": 0,
      "formattedAmount": "‏٣٠٠ ل.س.‏",
      "formattedAmountDue": "‏٠ ل.س.‏"
    }
  },
  {
    "check": "adversarial_settings:malformed country code ZZZ",
    "status": 400,
    "body": {
      "error": "Invalid timezone, currency, or country"
    }
  },
  {
    "check": "adversarial_settings:invalid timezone Invalid/Zone",
    "status": 400,
    "body": {
      "error": "Invalid timezone, currency, or country"
    }
  },
  {
    "check": "adversarial_settings:currency change without reset",
    "status": 409,
    "body": {
      "error": "currency_change_requires_reset",
      "current_currency": "SYP",
      "requested_currency": "GBP"
    }
  },
  {
    "check": "adversarial_settings:invalid phone for XK",
    "status": 400,
    "body": {
      "error": "Invalid phone number format. Please provide a valid phone number with optional country code."
    }
  },
  {
    "check": "switch_country_SL",
    "status": 200,
    "country": "SL",
    "timezone": "Africa/Freetown",
    "phone": "+23276123456"
  },
  {
    "check": "switch_country_CW",
    "status": 200,
    "country": "CW",
    "timezone": "America/Curacao",
    "phone": "+59995123456"
  },
  {
    "check": "switch_country_XK",
    "status": 200,
    "country": "XK",
    "timezone": "Europe/Belgrade",
    "phone": "+38344123456"
  },
  {
    "check": "switch_country_GL",
    "status": 200,
    "country": "GL",
    "timezone": "America/Nuuk",
    "phone": "+299551234"
  },
  {
    "check": "switch_country_CV",
    "status": 200,
    "country": "CV",
    "timezone": "Atlantic/Cape_Verde",
    "phone": "+2389912345"
  },
  {
    "check": "switch_country_TJ",
    "status": 200,
    "country": "TJ",
    "timezone": "Asia/Dushanbe",
    "phone": "+992901234567"
  },
  {
    "check": "switch_country_PS",
    "status": 200,
    "country": "PS",
    "timezone": "Asia/Hebron",
    "phone": "+970591234567"
  },
  {
    "check": "switch_country_FK",
    "status": 200,
    "country": "FK",
    "timezone": "Atlantic/Stanley",
    "phone": "+50051234"
  },
  {
    "check": "switch_country_SY",
    "status": 200,
    "country": "SY",
    "timezone": "Asia/Damascus",
    "phone": "+963912345678"
  }
]
Evidence: Live API transcript: adversarial setup rejections and Sierra Leone (SL/SLE) setup
[
  {
    "check": "adversarial_setup:unknown country ZZ",
    "status": 400,
    "body": {
      "error": "A valid country is required"
    }
  },
  {
    "check": "adversarial_setup:invalid currency ZZZ",
    "status": 400,
    "body": {
      "error": "Invalid currency"
    }
  },
  {
    "check": "adversarial_setup:invalid timezone Mars/Olympus",
    "status": 400,
    "body": {
      "error": "Invalid timezone"
    }
  },
  {
    "check": "adversarial_setup:invalid SL phone 123",
    "status": 400,
    "body": {
      "error": "Invalid phone number format. Please provide a valid phone number with optional country code."
    }
  },
  {
    "check": "happy_setup_SL",
    "status": 200,
    "tenant": {
      "country": "SL",
      "currency": "SLE",
      "currency_symbol": "Le",
      "currency_fraction_digits": 2,
      "timezone": "Africa/Freetown"
    }
  }
]

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
First-run setup UI searches and selects newly added countries (SY/SYP, CW/XCG, SL/SLE, XK/EUR), populates default currency and timezone, and completes setup ✅ pass live ~/.no-mistakes/evidence/01M7GDY8V41EQR3ZSD3H6N0GNV/setup-syria-selected.png
Settings > Store Details lists all 245 countries/territories, updates default timezone, recommended currency, and phone dial code on switch, and persists across reload ✅ pass live ~/.no-mistakes/evidence/01M7GDY8V41EQR3ZSD3H6N0GNV/settings-syria-switched.png
Customers, POS, Orders, and delivery-slip payment formatting in newly added region (SY/SYP) normalize local +963 phone numbers and render SYP (ل.س.) rather than bare £ ✅ pass live ~/.no-mistakes/evidence/01M7GDY8V41EQR3ZSD3H6N0GNV/pos-sy-syp.png
Adversarial regional inputs are rejected by setup and settings endpoints while redenominated Sierra Leone (SL/SLE) initializes cleanly ✅ pass live ~/.no-mistakes/evidence/01M7GDY8V41EQR3ZSD3H6N0GNV/live-api-setup-adversarial.txt
  • npm run test:currency
  • npm run test:country-localization
  • npm run test:phone
  • npm run test:print-parity
  • npm run test:receipt-column-oracle
  • npm run test:country-provenance
  • npm run build && npm run build:frontend
  • Live Playwright browser walkthrough on isolated dev-server.js (PORT=3101): /setup (Syria SY, XCG/Curaçao CW), /settings?tab=store (CW -> SY switch, +963 phone normalization, reload persistence), /customers (+963 dial code customer creation)
  • Live Playwright browser + Express API end-to-end verification on isolated dev-server.js (PORT=3151): SY/SYP setup, POS menu, order/bill/payment, delivery-slip-payment formatting, adversarial settings checks, and 9-country PUT /api/settings/business switching
  • Live Express API adversarial setup & SL/SLE verification on isolated dev-server.js (PORT=3161)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Add all 114 missing ISO 3166-1 countries and territories from libphonenumber-js (including SY) to main/countries.ts with verified locale, ISO 4217 currency, and IANA timezone defaults, add newly exposed Cyrillic and Belarusian currency ASCII fallbacks, and enforce full catalog invariants in country-profile tests.

Fixes #1585
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@khaira777 khaira777 changed the title feat: add missing country and territory profiles feat(i18n): add missing countries to catalog Nov 15, 2026
@khaira777

Copy link
Copy Markdown
Contributor Author

@greptile review

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Expands the country catalog to 245 profiles and improves currency text on thermal receipts.

  • Store setup now offers 245 country and territory profiles.
  • Thermal receipts now keep currency labels clear and readable.

No actionable issues found. khaira777 explicitly deferred translated README updates under the single-owner policy.

Lint, builds, documentation/i18n checks, and test suites were not run; dependencies are not installed.

Reviews (1) · Last reviewed commit: "no-mistakes(document): docs: update READ..." · Reviewed by Greptile

…alidation (Linux)` failed in `node scripts/ci/check-changed-format.cjs` because `tests/currency-print-fallback.test.ts` failed `oxfmt --check` (exceeding the 100-character `printWidth` in `.oxfmtrc.json` at line 9's import from `../shared/print/thermal-capabilities` and line 69's `assertEqualOrThrow` call). 2. `Required Checks Gate` failed solely because `Lint & Build Validation (Linux)` (`linux-baseline`) reported `failure` (`e2e-playwright` succeeded and `windows-uninstaller` was skipped). 3. Because `scripts/ci/check-changed-format.cjs` stops on the first failing package (`root`) before checking `frontend`, I also audited the 4 changed `frontend/src/lib/printer/` files against `frontend/.oxfmtrc.json` (`printWidth: 100`) and found a pre-existing 133-character signature on `normalizeThermalText` in `frontend/src/lib/printer/unicode.ts` (line 16) that would fail `oxfmt --check` once the root check passed. Changes made (formatting-only line wrapping to <= 100 chars matching `.oxfmtrc.json` / `frontend/.oxfmtrc.json`): - `tests/currency-print-fallback.test.ts`: wrapped the `../shared/print/thermal-capabilities` import and the `Tajikistani somoni price line` `assertEqualOrThrow` call across lines with trailing commas. - `frontend/src/lib/printer/unicode.ts`: wrapped the `normalizeThermalText` parameter list across lines with a trailing comma. Verification: - `git diff --check` passed (exit 0). - `node scripts/ci/validate-test-script-coverage.cjs` and `node tests/test-script-coverage.test.cjs` passed (300 reachable, 8 explicitly excluded; 366 run by default suite). - Could not run `oxfmt`, `oxlint`, or `ts-node` locally because `node_modules` and `frontend/node_modules` are not installed in this worktree and those binaries are not on `PATH`
@khaira777 khaira777 changed the title feat(i18n): add missing countries to catalog feat: add missing country and territory profiles to catalog Nov 15, 2026
@khaira777 khaira777 changed the title feat: add missing country and territory profiles to catalog feat(i18n): add missing countries to catalog Nov 15, 2026
@khaira777
khaira777 merged commit ee39e2d into main Nov 15, 2026
23 checks passed
@khaira777
khaira777 deleted the feat/flocafe-missing-countries branch November 15, 2026 21:05
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.

feat(i18n): add missing ISO countries and territories to country catalog

1 participant