Skip to content

feat: add scoreline prediction, points_earned (1/3/4 rules), and totalPoints to user score#986

Open
Timrossid wants to merge 1 commit into
Arena1X:mainfrom
Timrossid:feat/scoreline-points-prediction
Open

feat: add scoreline prediction, points_earned (1/3/4 rules), and totalPoints to user score#986
Timrossid wants to merge 1 commit into
Arena1X:mainfrom
Timrossid:feat/scoreline-points-prediction

Conversation

@Timrossid

@Timrossid Timrossid commented Jun 17, 2026

Copy link
Copy Markdown

Summary

Adds predicted scoreline storage, computed points_earned using 1/3/4-point rules, and totalPoints to the user score endpoint.

Changes

  • Entity: Added predicted_home_score, predicted_away_score, points_earned columns to MatchPrediction
  • Migration: 1775900000000-AddScorelineAndPointsToMatchPrediction
  • Indexer:
    • extractEventData now includes predicted_home_score / predicted_away_score from the event
    • handlePredictionSubmitted derives predicted_outcome from the scoreline (with fallback to the contract value for backwards compatibility)
    • gradePredictions computes points: 4 for exact score, 3 for correct goal difference, 1 for correct outcome only, 0 for incorrect (all × points_multiplier)
  • DTO: UserScoreResponseDto now includes otalPoints
  • Service: CreatorEventsService.getUserScore computes otalPoints from the match_predictions table

Acceptance Criteria

  • match_predictions table has predicted_home_score, predicted_away_score, points_earned columns
  • calculatePredictionPoints returns 4 for exact-score correct, 3 for correct GD, 1 for correct outcome, 0 for incorrect
  • handleMatchResultSubmitted grades all predictions and computes points_earned
  • GET /creator-events/:id/score/:address includes totalPoints

Closes #955

…lPoints to user score

- Add predicted_home_score, predicted_away_score, points_earned to MatchPrediction entity
- Create migration for new match_predictions columns
- Derive predicted_outcome from scoreline in handlePredictionSubmitted
- Grade predictions with 1/3/4-point rules (× points_multiplier) in gradePredictions
- Include totalPoints in GET /creator-events/:id/score/:address response
- Add Match, MatchPrediction, User repos to CreatorEventsService
@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
insight-arena-4rll Ready Ready Preview, Comment Jun 17, 2026 9:00pm

@Olowodarey

Copy link
Copy Markdown
Collaborator

@Timrossid pls help fix test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend] — Scoreline predictions & points-based grading (1 / 3 / 4 points)

2 participants