From 6ff7edf193bfb9baf51b4907a9fe0da49a95f533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Falc=C3=B3n?= Date: Sat, 4 Jul 2026 21:10:58 +0200 Subject: [PATCH] feat(currencies): add Nigerian Naira (NGN) (#642) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Adds the Nigerian Naira (NGN, ₦) as a selectable currency. Conversion support required no code change: rates come from the fawazahmed0 currency-api CDN, which already serves NGN (verified live, e.g. `EUR→NGN ≈ 1566.8`). `ExchangeRateService` / `CurrencyConversionService` are currency-agnostic, so NGN converts as soon as it's a valid option. ## Changes - `config/currencies.php` — add NGN entry (allowed as both primary and account currency). - `resources/js/utils/currency.ts` — add `₦` to the symbol map. - `lang/es.json` — Spanish translation for the currency name. - `tests/Feature/CurrencyOptionsTest.php` — assert NGN is exposed as a primary and account currency. ## Testing - `php artisan test tests/Feature/CurrencyOptionsTest.php tests/Feature/CurrencyConversionServiceTest.php tests/Feature/LocalizationTest.php` — pass - `vendor/bin/pint`, `bun run format`, `bun run lint`, `vitest run currency.test.ts` — pass --- config/currencies.php | 6 ++++++ lang/es.json | 1 + resources/js/utils/currency.ts | 1 + 3 files changed, 8 insertions(+) diff --git a/config/currencies.php b/config/currencies.php index ffa78db8..c3cc3732 100644 --- a/config/currencies.php +++ b/config/currencies.php @@ -152,5 +152,11 @@ return [ 'allows_primary' => true, 'allows_account' => true, ], + [ + 'code' => 'NGN', + 'name' => 'Nigerian Naira', + 'allows_primary' => true, + 'allows_account' => true, + ], ], ]; diff --git a/lang/es.json b/lang/es.json index bd9b9c43..96df9c59 100644 --- a/lang/es.json +++ b/lang/es.json @@ -1545,6 +1545,7 @@ "Syncing transactions and balances…": "Sincronizando transacciones y balances…", "System": "Sistema", "Serbian Dinar": "Dinar Serbio", + "Nigerian Naira": "Naira Nigeriano", "Take control of your finances with privacy-first money tracking. Let's set up your account in just a few minutes.": "Toma el control de tus finanzas con un seguimiento privado de tu dinero. Vamos a configurar tu cuenta en pocos minutos.", "Tap": "Toca", "Tap the": "Toca el botón", diff --git a/resources/js/utils/currency.ts b/resources/js/utils/currency.ts index 739a6cdf..2ecb04d2 100644 --- a/resources/js/utils/currency.ts +++ b/resources/js/utils/currency.ts @@ -25,6 +25,7 @@ export function getCurrencySymbol(currencyCode: string): string { JPY: '¥', NZD: 'NZ$', DOP: 'RD$', + NGN: '₦', }; return symbols[currencyCode] || currencyCode; }