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.

A season is the top-level container for a competition period. Everything in the platform — groups, team enrollments, player rosters, fixtures, and standings — belongs to a season. Only one season can be active at a time; the active season is the one displayed to users by default across the site.

Create and set up a new season

1

Open the seasons section

In the admin panel sidebar, click Seasons. You will see a list of all seasons ordered by start date.
2

Click 'New season'

Fill in the required fields:
FieldRequiredDescription
nameYesDisplay name for the season, for example 2025/2026.
start_dateNoISO date when the season begins.
end_dateNoISO date when the season ends.
is_activeNoSet to true to make this the active season immediately.
import_fromNoID of a previous season to copy groups and rosters from.
3

Optionally import from a previous season

If you provide an import_from season ID, the creation runs as a single atomic transaction that clones: - All groups from the source season into the new season. - All team statistics records (reset to zero) for every team that was enrolled in the source season. - All player roster entries (team_players) including jersey numbers, so players carry their squad numbers into the new season.You can still change group assignments and roster details afterwards.
4

Save and verify

The API returns the newly created season object. If you set is_active = true, all other seasons are deactivated automatically within the same transaction.
The import_from field on season creation and the separate POST /seasons/:id/import-structure endpoint perform the same cloning operation. Use import_from during creation to do everything in one step. Use the import-structure endpoint if you need to import into a season that already exists.

Setting a season as active

Only one season can be active at a time. When you set is_active = true on a season — either during creation or via an edit — the system automatically sets all other seasons to is_active = false before activating the selected one. The active season is used as the default filter across all public-facing pages: the match calendar, standings, statistics, and team detail views all default to the active season unless the user or API call specifies otherwise. To change the active season, edit any season and enable its Active toggle. The switch happens atomically — there is never a moment where no season or more than one season is active.

Editing a season

Send a PUT request to /seasons/:id with any combination of name, start_date, end_date, and is_active. All four fields are updated in the same call. The response returns the updated season object. Every edit is recorded in the audit log.

Importing structure from a previous season

If you already created a season and want to copy the structure from an older one, use the dedicated import endpoint:
POST /seasons/:id/import-structure
Request body:
{ "fromSeasonId": 3 }
This operation runs inside a database transaction and clones three things:
  1. Groups — Every group from the source season is recreated under the new season with the same name. The response includes a count of how many groups were imported.
  2. Team statistics — A zeroed-out team_stats record is created for every team that had statistics in the source season. This enrolls teams in the new season without carrying over points, wins, or goals.
  3. Player rosters — Every team_players entry from the source season is copied into the new season, preserving team assignments and jersey numbers. Duplicate entries are silently ignored.
After the import, teams are enrolled but not yet assigned to groups. Assign them to groups from the Competitions section.

Deleting a season

Deleting a season is a hard delete. It cascades to all dependent records: groups, team statistics, player roster entries, fixtures, and match events belonging to that season are all permanently removed. This action cannot be undone. Consider archiving by deactivating the season instead.
To delete, send a DELETE request to /seasons/:id. If the season has dependent records that cannot be cascaded (for example, if a foreign key constraint blocks deletion), the API returns a descriptive error message. The deletion is logged in the audit trail with the season name captured before removal.

Build docs developers (and LLMs) love