Fix Frankfurter integration: require namespace, use v1 API, show converted BTC prices

- Require frankfurter.rates namespace in core.clj so Integrant can find it
- Use /v1/ prefix for self-hosted Frankfurter API
- Display BTC price converted to EUR and DKK instead of raw exchange rates
- Remove unused host port mapping for Frankfurter container

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 14:43:19 +01:00
co-authored by Claude Opus 4.6
parent 7d6ca3911f
commit 46666aa994
4 changed files with 9 additions and 10 deletions
+6 -6
View File
@@ -23,8 +23,8 @@
(cond-> {:price (str price)
:prev_price (when prev-price (str prev-price))
:recorded_at (str recorded-at)}
rates (assoc :eur (str (:eur rates))
:dkk (str (:dkk rates))))))
rates (assoc :price_eur (str (.multiply (bigdec price) (:eur rates)))
:price_dkk (str (.multiply (bigdec price) (:dkk rates)))))))
(def ^:private ts-fmt (DateTimeFormatter/ofPattern "dd-MM HH:mm:ss"))
@@ -42,11 +42,11 @@
"<div class=\"text-center\">"
"<p class=\"text-4xl font-bold " color "\">$" (format "%,.2f" p) "</p>"
(when rates
(let [eur (double (:eur rates))
dkk (double (:dkk rates))]
(let [p-eur (double (.multiply (bigdec price) (:eur rates)))
p-dkk (double (.multiply (bigdec price) (:dkk rates)))]
(str "<div class=\"flex justify-center gap-4 mt-3\">"
"<span class=\"text-sm text-gray-600\">EUR " (format "%.4f" eur) "</span>"
"<span class=\"text-sm text-gray-600\">DKK " (format "%.4f" dkk) "</span>"
"<span class=\"text-sm text-gray-600\">\u20AC" (format "%,.2f" p-eur) "</span>"
"<span class=\"text-sm text-gray-600\">" (format "%,.2f" p-dkk) " kr</span>"
"</div>")))
"<p class=\"text-xs text-gray-400 mt-2\">Updated " ts "</p>"
"</div></div></div>")))