fix: track and persist elo rating changes history#267
fix: track and persist elo rating changes history#267VishalPainjane wants to merge 2 commits intoAOSSIE-Org:mainfrom
Conversation
📝 WalkthroughWalkthroughThis PR implements Elo rating change tracking in debate history by adding an Changes
Sequence DiagramsequenceDiagram
participant Controller
participant Service as TranscriptService
participant DB as Database
Controller->>Service: SubmitTranscripts(ratingUpdates)
activate Service
Service->>Service: UpdateRatings()
Note over Service: Returns RatingChange for each user
Service->>Service: Compute forUser EloChange
Service->>Service: Compute againstUser EloChange
Service->>DB: Save User A's Transcript<br/>(with eloChange)
Service->>DB: Save User B's Transcript<br/>(with eloChange)
Service->>DB: Persist Debate Record
deactivate Service
Service-->>Controller: Return ratingSummary
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
hello @VishalPainjane i am already generate pr on this issue |
|
@Abhishek2005-ard please read the issue description properly and follow the guidelines, I was working over the issue |
Description
This PR implements the missing functionality for storing and retrieving Elo rating changes for each debate match. Previously, the "Recent Debates" section in user profiles displayed a "0" change for all matches because the rating delta was not being persisted.
Changes
EloChange(float64) field to theSavedDebateTranscriptstruct inbackend/models/transcript.go.transcriptservice.goto calculate ratings before saving the transcript. This ensures the rating delta is captured and saved with the debate record.profile_controller.goto return the actual stored Elo change instead of a hardcoded placeholder. Updateddebatevsbot_controller.goandtranscript_controller.goto support the new function signature.Fixes
TODO: Add actual Elo change trackingplaceholder in the profile controller.Testing
EloChangefield is correctly marshaled and stored using a model verification script.closes #265
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.