Fix: Add match_number to extraction_stats in incremental reports sync

- Added match_number field to extraction stats data sent during incremental sync
- This allows proper correlation of extraction stats with match results on server side
- Fixes issue where extractions_stats field had no relative matches with results
parent c8ed55c0
......@@ -1205,13 +1205,15 @@ class ReportsSyncResponseHandler(ResponseHandler):
# Add extraction stats (only new/updated stats)
for stat in stats_to_sync:
# Get the match to retrieve the stored accumulated shortfall and cap_percent at completion time
# Get the match to retrieve the stored accumulated shortfall, cap_percent, and match_number at completion time
match = session.query(MatchModel).filter_by(id=stat.match_id).first()
accumulated_shortfall = float(match.accumulated_shortfall) if match and match.accumulated_shortfall is not None else 0.0
cap_percent = float(match.cap_percent) if match and match.cap_percent is not None else 70.0
match_number = match.match_number if match else None
stat_data = {
'match_id': stat.match_id,
'match_number': match_number, # Include match_number for correlation with results
'fixture_id': stat.fixture_id,
'match_datetime': stat.match_datetime.isoformat(),
'total_bets': stat.total_bets,
......
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