Commit 19c5baec authored by Your Name's avatar Your Name

Fix winning bets count always showing zero in match reports

The result column on BetDetail uses the value 'win' (matching the client
enum), but both counting paths in the sync route were comparing against
'won'. The mismatch meant winning_bets was always 0 regardless of how
many bets had been settled as wins.
Co-Authored-By: 's avatarClaude Sonnet 4.6 <noreply@anthropic.com>
parent aab8d769
......@@ -1368,7 +1368,7 @@ def api_reports_sync():
).group_by(BetDetail.result, BetDetail.match_number)
for result, match_num, count in bet_details_query.all():
if result == 'won':
if result == 'win':
winning_bets = count
elif result == 'lost':
losing_bets = count
......@@ -1491,7 +1491,7 @@ def api_reports_sync():
).group_by(BetDetail.result)
for result, count, total_win in bet_details_query.all():
if result == 'won':
if result == 'win':
winning_bets = count
total_payout += float(total_win) if total_win is not None else 0.0
elif result == 'lost':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment