The prediction system lets registered users forecast the result of every upcoming match. Pick the home win, a draw, or the away win before the match starts, and earn a point for each correct prediction. Points accumulate over the season and are ranked on a public leaderboard, so every match is a chance to climb the table.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Danielsl4/TFG_DAM_2526_Consulta2/llms.txt
Use this file to discover all available pages before exploring further.
How voting works
Before a match begins, each match card shows three prediction buttons:- Local — home team wins
- Empate — the match ends in a draw
- Visitante — away team wins
match_votes table, one row per user per match. Submitting a new prediction before kick-off replaces your previous vote automatically, so you can change your mind any number of times until the match status moves to en_curso.
Once a match is in progress or has finished, the vote buttons are hidden. The voting bar remains visible, showing the percentage breakdown of all predictions cast.
Voting is only available for authenticated users. Guest visitors can see the current vote distribution on each match card, but cannot submit a prediction.
Earning points
When a referee marks a match asfinalizado, the system determines the real outcome:
local— home team scored more goalsempate— both teams scored the same number of goalsvisitante— away team scored more goals
user_points table, keyed to the user and the current season. The match’s match_votes rows are also updated with points_awarded = 1 for correct predictions, giving you a full history of which calls you got right.
Leaderboard
The season leaderboard ranks all registered users by their total prediction points for the selected season. Users with zero votes or zero correct predictions still appear on the board with 0 points. Ties are broken alphabetically by username. The top 10 users are shown by default. You can also view your own stats — total points, current rank, and a history of your last 20 predictions with the real result alongside each one — in your profile area.Restrictions
Not every match is open for voting. A match must satisfy all of the following conditions before the vote buttons appear:- Status is
pendiente— the match has not started yet - Both
home_team_idandaway_team_idare confirmed — placeholder teams are not votable - The user is authenticated
(match_id, user_id).
Submitting a prediction
Navigate to a match
Open the match calendar and select any upcoming match with a status of
pendiente and both teams confirmed.Click your prediction
Tap Local, Empate, or Visitante on the match card. Your choice is saved immediately and highlighted to confirm the vote.
See live vote stats
After voting, the prediction bar updates to show the current distribution across all users. You can change your vote at any time before the match starts.