Open-source personal finance manager. Self-hosted, privacy-first.
feat: add Pakistani rupee (PKR) currency support (#867)
BingEdward40a36d57ac7b
diff --git a/backend/app/api/currencies.py b/backend/app/api/currencies.pyindex 06aa9d29..a8302444 100644--- a/backend/app/api/currencies.py+++ b/backend/app/api/currencies.py@@ -40,6 +40,7 @@ CURRENCY_META = {"VND": {"symbol": "₫", "name": "Vietnamese Dong", "flag": "\U0001F1FB\U0001F1F3"},"SGD": {"symbol": "S$", "name": "Singapore Dollar", "flag": "\U0001F1F8\U0001F1EC"},"TRY": {"symbol": "₺", "name": "Turkish Lira", "flag": "\U0001F1F9\U0001F1F7"},+ "PKR": {"symbol": "₨", "name": "Pakistani Rupee", "flag": "\U0001F1F5\U0001F1F0"},}diff --git a/backend/app/core/config.py b/backend/app/core/config.pyindex f8426141..6986e375 100644--- a/backend/app/core/config.py+++ b/backend/app/core/config.py@@ -66,7 +66,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,NZD,VND,SGD,AZN,TRY" # 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,VND,SGD,AZN,TRY,PKR" # 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 88ddac68..5184b89b 100644--- a/backend/tests/test_currencies_api.py+++ b/backend/tests/test_currencies_api.py@@ -119,3 +119,15 @@ async def test_currencies_include_try_with_metadata(client: AsyncClient):assert turkish_lira["symbol"] == "₺"assert turkish_lira["name"] == "Turkish Lira"assert turkish_lira["flag"] == "🇹🇷"+++async def test_currencies_include_pkr_with_metadata(client: AsyncClient):+ response = await client.get("/api/currencies")+ data = response.json()+ pkr = next((currency for currency in data if currency["code"] == "PKR"), None)++ assert pkr is not None+ assert pkr["symbol"] == "₨"+ assert pkr["name"] == "Pakistani Rupee"+ assert pkr["flag"] == "🇵🇰"diff --git a/frontend/src/components/currency-select.tsx b/frontend/src/components/currency-select.tsxindex 791f29b3..1099a9b8 100644--- a/frontend/src/components/currency-select.tsx+++ b/frontend/src/components/currency-select.tsx@@ -42,6 +42,7 @@ export const CURRENCIES = [{ code: 'VND', flag: '\u{1F1FB}\u{1F1F3}', symbol: '₫' },{ code: 'SGD', flag: '\u{1F1F8}\u{1F1EC}', symbol: 'S$' },{ code: 'TRY', flag: '\u{1F1F9}\u{1F1F7}', symbol: '₺' },+ { code: 'PKR', flag: '\u{1F1F5}\u{1F1F0}', symbol: '₨' },] as constinterface CurrencySelectProps {diff --git a/frontend/src/lib/format.ts b/frontend/src/lib/format.tsindex 3f99de8e..65cfc96b 100644--- a/frontend/src/lib/format.ts+++ b/frontend/src/lib/format.ts@@ -65,6 +65,7 @@ const CURRENCY_LOCALE: Record<string, string> = {SGD: 'en-SG',AZN: 'az-AZ',TRY: 'tr-TR',+ PKR: 'en-PK',}/**