The voting system lets authenticated users predict the outcome of upcoming matches. Each user can vote once per match, but may update their vote at any time while the match is stillDocumentation 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.
pendiente. When a match is finalized, every user whose vote matched the actual result receives 1 point added to their season ranking.
Voting closes the moment the match status changes away from
pendiente. Make sure to cast your vote before the match starts.Cast or update a vote
Authentication
Required. Any authenticated user (user, referee, or admin role) may vote.
Path parameters
Match ID to vote on.
Body parameters
Predicted outcome. Must be one of:
| Value | Meaning |
|---|---|
local | Home team wins |
empate | Draw |
visitante | Away team wins |
Restrictions
- The match
statusmust bependiente. Voting on a match that isen_cursoorfinalizadoreturns400. - Both
homeTeamandawayTeammust be assigned (notnull). Voting on a match with unresolved team slots returns400.
Response
Confirmation message.
Updated aggregate vote counts after recording the vote.
Error responses
| Status | Condition |
|---|---|
400 | vote value is not local, empate, or visitante |
400 | Match is not in pendiente status |
400 | One or both teams are not yet assigned |
404 | Match not found |
401 | No token provided or token invalid |
Point award logic
When a referee callsPUT /matches/:id/finish, the server:
- Determines the result:
local(home goals > away goals),visitante(away goals > home goals), orempate(equal). - Marks all matching votes with
points_awarded = 1. - Increments the
pointscounter inuser_pointsfor every correct voter for the current season.
Examples
Get last global activity
Authentication
None required.Response
timestamp is null when no activity has been recorded yet.