Competitions in the Futsal League Manager are built from three layers: seasons define a time-bounded edition of the league, groups partition teams within a season (e.g., Group A, Group B), and fields are the physical venues where matches are played. Setting these up correctly before scheduling any matches is essential.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.
Seasons
A season is the top-level container for an entire league edition. Each season has the following fields:| Field | Type | Description |
|---|---|---|
name | string | Display name, e.g. "2024/2025" |
start_date | date | The date the season begins |
end_date | date | The date the season ends |
is_active | boolean | Whether this is the currently active season |
POST /seasons requires at minimum a name. Optionally pass start_date, end_date, and is_active. You can also supply an import_from season ID to atomically clone groups, team stats, and player enrollments from a previous season into the new one.
Editing a season — PUT /seasons/:id accepts the same fields. Updating is_active to true automatically deactivates every other season.
Deleting a season — DELETE /seasons/:id performs a hard delete. The operation fails if the season still has dependent records such as groups or matches.
Importing structure — POST /seasons/:id/import-structure copies groups, team stats, and player rosters from another season (fromSeasonId in the request body) into the target season. Teams arrive without group assignments so you can re-arrange them.
Groups
Groups subdivide a season into competitive pools. A typical setup has Group A and Group B, each containing its own standings table.| Field | Type | Description |
|---|---|---|
name | string | Group label, e.g. "Group A" |
season_id | integer | The season this group belongs to |
POST /groups requires both name and season_id.
Editing a group — PUT /groups/:id accepts name and season_id.
Deleting a group — DELETE /groups/:id performs a hard delete. If the group has associated matches, the delete is blocked by the database.
Assigning teams to a group — POST /groups/:id/teams creates a team_stats record that links a team to the group for a specific season. This is what places a team in the standings table. Provide team_id and season_id in the request body.
Removing teams from a group — DELETE /groups/:id/teams/:teamId (with season_id as a query parameter) removes the team_stats record, effectively unassigning the team from that group.
Fields
Fields are the playing venues assigned to individual matches. Each field has two attributes:| Field | Type | Description |
|---|---|---|
name | string | Name of the venue |
location | text | Address or descriptive location |
POST /fields requires a name; location is optional.
Editing a field — PUT /fields/:id accepts name and location.
Soft-deleting a field — DELETE /fields/:id sets is_active = false. The field no longer appears in the public list but is preserved in match history. Deleted fields appear in the trash at GET /fields/admin/trash.
Restoring a field — POST /fields/:id/restore sets is_active = true again.
Permanently deleting a field — DELETE /fields/:id/permanent removes the record from the database. This requires the field to already be in the trash (is_active = false). The operation fails with a 400 error if any match references the field.
Creating a competition flow
Follow these steps to set up a new league edition from scratch:Create a season
Go to Competitions → Seasons and click New season. Enter the name, start date, and end date. Optionally import groups and rosters from a previous season using the
import_from field.Activate the season
Toggle
is_active to true on the new season (or set it during creation). This deactivates any previously active season and ensures the public-facing pages reflect the correct edition.Create groups
Under Competitions → Groups, create one or more groups and assign them to the new season. Typical names are
"Group A" and "Group B".Register teams
In Teams, register each participating team for the season using
POST /teams/:id/register with the season ID, then assign them to a group via POST /groups/:groupId/teams.