Currency and Exchange Rates
Cashlytics supports multi-currency display, transaction metadata, and a converter tool.
Settings
User settings store locale and base currency. Defaults come from NEXT_PUBLIC_DEFAULT_LOCALE and NEXT_PUBLIC_DEFAULT_CURRENCY when no user-specific setting exists.
Supported Currencies
The supported currency list is defined in src/lib/currency.ts and includes EUR, USD, JPY, GBP, CNY, CHF, AUD, CAD, HKD, SGD, KRW, MXN, INR, NZD, SEK, NOK, PLN, TRY, ZAR, BRL, and DKK.
Exchange Rate Source
src/lib/exchange-rates.ts fetches EUR-based rates from the Frankfurter API and persists them in the exchange_rates table. Cache TTL is 24 hours.
Fetch priority is:
- fresh database cache
- Frankfurter API refresh when stale or empty
- stale database cache if the API is unavailable
- built-in fallback rates
API
GET /api/exchange-rates returns current rates with EUR as base. The Tools page calls this endpoint with cache: "no-store".
Transaction writes can store original amount, saved currency, and exchange rate metadata so later display does not depend only on current rates.