From 92d883ff902fae8801a421bbbf12e00d59790f98 Mon Sep 17 00:00:00 2001 From: Developer Date: Sat, 10 Oct 2026 20:44:19 -0400 Subject: [PATCH] fix(backend): cast cost calculation to numeric for postgresql round compatibility --- backend/motorsignal_api/app/road_alerts/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/motorsignal_api/app/road_alerts/cache.py b/backend/motorsignal_api/app/road_alerts/cache.py index 5de6fc7..161c3dc 100644 --- a/backend/motorsignal_api/app/road_alerts/cache.py +++ b/backend/motorsignal_api/app/road_alerts/cache.py @@ -308,7 +308,7 @@ class PersistentUsageTracker: stmt = text(""" UPDATE provider_monthly_usage SET requests_executed = requests_executed + 1, - estimated_cost_usd = round((requests_executed + 1) * :cost_per_req, 4), + estimated_cost_usd = round(CAST((requests_executed + 1) * :cost_per_req AS numeric), 4), updated_at = :now WHERE provider_id = :provider_id AND period_month = :period """)