Open-source personal finance manager. Self-hosted, privacy-first.
feat: add New Zealand Dollar (NZD) currency support (#555)
Tássio Noronhae2e4390f3ce8
diff --git a/backend/app/api/currencies.py b/backend/app/api/currencies.pyindex d154b187..f35eee5d 100644--- a/backend/app/api/currencies.py+++ b/backend/app/api/currencies.py@@ -35,6 +35,7 @@ CURRENCY_META = {"GTQ": {"symbol": "Q", "name": "Guatemalan Quetzal", "flag": "\U0001F1EC\U0001F1F9"},"PHP": {"symbol": "₱", "name": "Philippine Peso", "flag": "\U0001F1F5\U0001F1ED"},"UAH": {"symbol": "₴", "name": "Ukrainian Hryvnia", "flag": "\U0001F1FA\U0001F1E6"},+ "NZD": {"symbol": "NZ$", "name": "New Zealand Dollar", "flag": "\U0001F1F3\U0001F1FF"},}diff --git a/backend/app/core/config.py b/backend/app/core/config.pyindex 2a43882b..b8ae10e2 100644--- a/backend/app/core/config.py+++ b/backend/app/core/config.py@@ -65,7 +65,7 @@ class Settings(BaseSettings):# FX Ratesopenexchangerates_app_id: str = ""- supported_currencies: str = "USD,EUR,GBP,BRL,CAD,AUD,CHF,ARS,JPY,MXN,INR,SEK,DKK,NOK,PLN,CZK,HUF,RON,CRC,IDR,COP,CLP,DOP,RUB,GTQ,PHP,UAH" # comma-separated list+ supported_currencies: str = "USD,EUR,GBP,BRL,CAD,AUD,CHF,ARS,JPY,MXN,INR,SEK,DKK,NOK,PLN,CZK,HUF,RON,CRC,IDR,COP,CLP,DOP,RUB,GTQ,PHP,UAH,NZD" # comma-separated listfx_sync_mode: str = "on_demand" # "on_demand" or "scheduled"# Storagediff --git a/backend/tests/test_currencies_api.py b/backend/tests/test_currencies_api.pyindex dee0b2ca..bf954821 100644--- a/backend/tests/test_currencies_api.py+++ b/backend/tests/test_currencies_api.py@@ -58,3 +58,15 @@ async def test_currencies_include_uah_with_metadata(client: AsyncClient):assert uah["symbol"] == "₴"assert uah["name"] == "Ukrainian Hryvnia"assert uah["flag"] == "🇺🇦"+++async def test_currencies_include_nzd_with_metadata(client: AsyncClient):+ response = await client.get("/api/currencies")+ data = response.json()+ nzd = next((currency for currency in data if currency["code"] == "NZD"), None)++ assert nzd is not None+ assert nzd["symbol"] == "NZ$"+ assert nzd["name"] == "New Zealand Dollar"+ assert nzd["flag"] == "🇳🇿"diff --git a/frontend/src/components/currency-select.tsx b/frontend/src/components/currency-select.tsxindex dc38d057..9f8d6ddf 100644--- a/frontend/src/components/currency-select.tsx+++ b/frontend/src/components/currency-select.tsx@@ -33,6 +33,7 @@ export const CURRENCIES = [{ code: 'GTQ', flag: '\u{1F1EC}\u{1F1F9}', symbol: 'Q' },{ code: 'PHP', flag: '\u{1F1F5}\u{1F1ED}', symbol: '₱' },{ code: 'UAH', flag: '\u{1F1FA}\u{1F1E6}', symbol: '₴' },+ { code: 'NZD', flag: '\u{1F1F3}\u{1F1FF}', symbol: 'NZ$' },] as constinterface CurrencySelectProps {diff --git a/frontend/src/lib/format.ts b/frontend/src/lib/format.tsindex dd5ea038..df9428eb 100644--- a/frontend/src/lib/format.ts+++ b/frontend/src/lib/format.ts@@ -60,6 +60,7 @@ const CURRENCY_LOCALE: Record<string, string> = {GTQ: 'es-GT',PHP: 'en-PH',UAH: 'uk-UA',+ NZD: 'en-NZ',}/**