Open-source personal finance manager. Self-hosted, privacy-first.
feat(currency): add Thai Baht support (#903)
Deepanshu Jainb03da839a8d7
diff --git a/backend/app/api/currencies.py b/backend/app/api/currencies.pyindex da375834..89cb619f 100644--- a/backend/app/api/currencies.py+++ b/backend/app/api/currencies.py@@ -43,6 +43,7 @@ CURRENCY_META = {"PKR": {"symbol": "₨", "name": "Pakistani Rupee", "flag": "\U0001F1F5\U0001F1F0"},"MDL": {"symbol": "L", "name": "Moldovan Leu", "flag": "\U0001F1F2\U0001F1E9"},"AED": {"symbol": "د.إ", "name": "UAE Dirham", "flag": "\U0001F1E6\U0001F1EA"},+ "THB": {"symbol": "\u0e3f", "name": "Thai Baht", "flag": "\U0001F1F9\U0001F1ED"},}diff --git a/backend/app/core/config.py b/backend/app/core/config.pyindex 8d51ff9e..e71c8ea9 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,PKR,MDL,AED" # 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,MDL,AED,THB" # 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 7f3f78da..04410ede 100644--- a/backend/tests/test_currencies_api.py+++ b/backend/tests/test_currencies_api.py@@ -152,3 +152,15 @@ async def test_currencies_include_aed_with_metadata(client: AsyncClient):assert aed["symbol"] == "د.إ"assert aed["name"] == "UAE Dirham"assert aed["flag"] == "🇦🇪"+++async def test_currencies_include_thb_with_metadata(client: AsyncClient):+ response = await client.get("/api/currencies")+ data = response.json()+ thb = next((currency for currency in data if currency["code"] == "THB"), None)++ assert thb is not None+ assert thb["symbol"] == "฿"+ assert thb["name"] == "Thai Baht"+ assert thb["flag"] == "🇹🇭"diff --git a/frontend/src/components/currency-select.tsx b/frontend/src/components/currency-select.tsxindex b44aeaef..e040e6b6 100644--- a/frontend/src/components/currency-select.tsx+++ b/frontend/src/components/currency-select.tsx@@ -45,6 +45,7 @@ export const CURRENCIES = [{ code: 'PKR', flag: '\u{1F1F5}\u{1F1F0}', symbol: '₨' },{ code: 'MDL', flag: '\u{1F1F2}\u{1F1E9}', symbol: 'L' },{ code: 'AED', flag: '\u{1F1E6}\u{1F1EA}', symbol: 'د.إ' },+ { code: 'THB', flag: '\u{1F1F9}\u{1F1ED}', symbol: '฿' },] as constinterface CurrencySelectProps {diff --git a/frontend/src/lib/format.ts b/frontend/src/lib/format.tsindex 390d1cb8..bc0777f1 100644--- a/frontend/src/lib/format.ts+++ b/frontend/src/lib/format.ts@@ -68,6 +68,7 @@ const CURRENCY_LOCALE: Record<string, string> = {PKR: 'en-PK',MDL: 'ro-MD',AED: 'ar-AE',+ THB: 'th-TH',}/**