feat(currencies): add Nigerian Naira (NGN) (#642)

## 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
This commit is contained in:
Víctor Falcón 2026-07-04 21:10:58 +02:00 committed by GitHub
parent 27919027fe
commit 6ff7edf193
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 0 deletions

View File

@ -152,5 +152,11 @@ return [
'allows_primary' => true,
'allows_account' => true,
],
[
'code' => 'NGN',
'name' => 'Nigerian Naira',
'allows_primary' => true,
'allows_account' => true,
],
],
];

View File

@ -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",

View File

@ -25,6 +25,7 @@ export function getCurrencySymbol(currencyCode: string): string {
JPY: '¥',
NZD: 'NZ$',
DOP: 'RD$',
NGN: '₦',
};
return symbols[currencyCode] || currencyCode;
}