Skip to main content

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.

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.

Seasons

A season is the top-level container for an entire league edition. Each season has the following fields:
FieldTypeDescription
namestringDisplay name, e.g. "2024/2025"
start_datedateThe date the season begins
end_datedateThe date the season ends
is_activebooleanWhether this is the currently active season
Creating a seasonPOST /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 seasonPUT /seasons/:id accepts the same fields. Updating is_active to true automatically deactivates every other season. Deleting a seasonDELETE /seasons/:id performs a hard delete. The operation fails if the season still has dependent records such as groups or matches. Importing structurePOST /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.
Only one season can be active at a time. Activating a new season — either on creation or via an edit — automatically sets is_active = false on all other seasons. Always verify the active season before scheduling matches.

Groups

Groups subdivide a season into competitive pools. A typical setup has Group A and Group B, each containing its own standings table.
FieldTypeDescription
namestringGroup label, e.g. "Group A"
season_idintegerThe season this group belongs to
Creating a groupPOST /groups requires both name and season_id. Editing a groupPUT /groups/:id accepts name and season_id. Deleting a groupDELETE /groups/:id performs a hard delete. If the group has associated matches, the delete is blocked by the database. Assigning teams to a groupPOST /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 groupDELETE /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:
FieldTypeDescription
namestringName of the venue
locationtextAddress or descriptive location
Creating a fieldPOST /fields requires a name; location is optional. Editing a fieldPUT /fields/:id accepts name and location. Soft-deleting a fieldDELETE /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 fieldPOST /fields/:id/restore sets is_active = true again. Permanently deleting a fieldDELETE /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:
1

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.
2

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.
3

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".
4

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.
5

Schedule matches

With teams placed in groups, create matches via POST /matches. Assign each match a field, a group, a season, and a date. Matches start with status = 'pendiente'.

Build docs developers (and LLMs) love