Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Danielsl4/TFG_DAM_2526_Consulta/llms.txt

Use this file to discover all available pages before exploring further.

The porra system lets you predict the result of every upcoming match. Correct predictions earn points that accumulate on a season leaderboard. You can track your score, ranking, and full voting history from the statistics page.

How voting works

1

Find a pending match

Open the match calendar or a match’s detail page. The voting widget appears on any match with status pendiente (pending) where both the home and away teams have been assigned.
2

Cast your vote

Select one of three options:
  • Local — home team wins
  • Empate — draw
  • Visitante — away team wins
Your vote is saved immediately. The widget updates to show the current vote distribution across all users.
3

Change your vote if needed

You can update your prediction at any time while the match is still pending. Submitting a new vote replaces your previous one — the system uses an upsert so only your latest vote is stored.
4

Wait for the result

Once a referee starts the match, voting closes. When the match is finalised, the system compares your prediction with the actual result and awards 1 point if you predicted correctly.
You must be logged in to cast a vote. Guest users can see the vote counts but cannot participate.

Requirements to vote

  • You must have an account and be logged in.
  • The match must have status pendiente.
  • Both the home team and away team must be assigned to the match. Knockout fixtures that show a placeholder (e.g. “Winner Group A”) cannot be voted on until the teams are confirmed.

Vote options

OptionMeaning
localHome team wins
empateThe match ends in a draw
visitanteAway team wins

Vote counts on the match card

The match card and detail page display a live breakdown of how many users voted for each outcome. These counts update as soon as any user casts or changes their vote.
Displayed countDescription
Home votesUsers who voted local
Draw votesUsers who voted empate
Away votesUsers who voted visitante
TotalSum of all three

Earning points

When a referee finalises a match, the system:
  1. Determines the actual result (local, empate, or visitante) from the final score.
  2. Marks every vote that matches the result with points_awarded = 1.
  3. Adds 1 point to the user_points table for each correct voter, scoped to the match’s season.
Points accumulate throughout the season. Each correct prediction earns exactly 1 point regardless of the size of the score difference.
Points are awarded atomically in the same database transaction that finalises the match, so your score updates the moment the match is closed.

Voting closes when the match starts

The moment a referee changes a match’s status from pendiente to en_curso (in progress), voting is locked. Any attempt to submit a vote on a non-pending match is rejected with an error.

Your prediction stats

When you are logged in, you can view your personal prediction record on the Statistics page under your account. Your stats include:
StatDescription
Total pointsAll points earned from correct predictions in the season
Global rankYour position among all users in the season leaderboard
Vote historyYour last 20 predictions for the season, showing the match, your vote, the actual result, and whether you earned a point
The vote history table shows:
ColumnDescription
MatchHome team vs away team and date
Your predictionlocal, empate, or visitante
Actual resultThe final outcome once the match is finished, or pendiente if still to play
Points1 if your prediction was correct, 0 otherwise

Season leaderboard

The top 10 users by points appear on the statistics page. Your row is highlighted so you can quickly spot your position even when scrolling.
The leaderboard is filtered to users with the user role. Admin and referee accounts are excluded.

Season scope

All votes and points are recorded per season. Points earned in one season do not carry over to the next. When a new season starts, everyone begins from zero.

Match calendar

Find pending matches and open the voting widget.

Statistics

View the season leaderboard and your full prediction history.

Build docs developers (and LLMs) love