fix(backend): cast cost calculation to numeric for postgresql round compatibility

This commit is contained in:
Developer 2026-10-10 20:44:19 -04:00
parent b552a43a6a
commit 92d883ff90
1 changed files with 1 additions and 1 deletions

View File

@ -308,7 +308,7 @@ class PersistentUsageTracker:
stmt = text(""" stmt = text("""
UPDATE provider_monthly_usage UPDATE provider_monthly_usage
SET requests_executed = requests_executed + 1, 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 updated_at = :now
WHERE provider_id = :provider_id AND period_month = :period WHERE provider_id = :provider_id AND period_month = :period
""") """)