Skip to main content

Overview

Team management is a core feature that allows you to register and organize teams participating in the tournament. Each team is associated with a municipality, led by a technical director, and contains a roster of players.
You must be logged in to create, edit, or delete teams. Viewing teams is available to all users.

Team Structure

Every team in the system consists of:
  • Team Name: Unique identifier for the team (3-50 characters)
  • Municipality: Geographic location the team represents
  • Technical Director: The coach leading the team
  • Player Roster: List of players assigned to the team
  • Match History: All matches played as home or away team

Creating a New Team

1

Access the Create Team Page

Navigate to the Teams section and click “Create New Team” or similar action button.Prerequisites: You must be logged in with a valid account.
2

Enter Team Information

Fill in the required team details:
  • Team Name: Enter a unique name (3-50 characters, letters and spaces allowed)
  • Municipality: Select from the dropdown list of available municipalities
  • Technical Director: Choose a technical director from the available coaches
If no municipalities or technical directors are available, you’ll need to create them first before adding a team.
3

Validate Input

The system automatically validates your input:
  • Team name must be unique (no duplicates)
  • Name cannot consist only of numbers
  • Name must be between 3-50 characters
  • Municipality and technical director must be selected
4

Submit & Confirm

Click the submit button to create the team. If successful, you’ll be redirected to the teams index page where your new team appears in the list.If there are validation errors, you’ll see specific error messages indicating what needs to be corrected.

Viewing Teams

The Teams Index page provides multiple ways to browse and find teams:

List View

All teams are displayed in a list format showing:
  • Team name
  • Municipality
  • Technical director
  • Action buttons (View Details, Edit, Delete)

Filtering by Municipality

1

Select Municipality

Use the municipality dropdown filter at the top of the teams list.
2

View Filtered Results

The page refreshes to show only teams from the selected municipality.
3

Clear Filter

Select “All” or the default option to view teams from all municipalities.

Search by Name

1

Enter Search Term

Type the team name (or partial name) in the search box.
2

Submit Search

Click the search button to filter results.
3

View Results

Teams matching your search criteria are displayed. Clear the search box to view all teams again.

Editing Team Details

Editing teams requires authentication.
1

Select Team to Edit

From the Teams Index page, click the “Edit” button next to the team you want to modify.
2

Update Information

The edit form displays current team information with the ability to modify:
  • Team name
  • Municipality assignment
  • Technical director assignment
The original values are pre-selected in dropdown menus for easy reference.
3

Duplicate Detection

If you change the team name, the system checks for duplicates:
  • If the name is unchanged, the update proceeds without duplicate validation
  • If the name changes, it must not match any existing team name
4

Save Changes

Click submit to save your changes. On success, you’re redirected to the Teams Index page with the updated information.

Deleting Teams

Deleting a team is a permanent action. Teams involved in scheduled matches may not be deletable due to referential integrity.
1

Select Team

Find the team you want to delete in the Teams Index.
2

Initiate Deletion

Click the “Delete” button next to the team.
3

Handle Constraints

  • Success: If the team has no dependencies (no scheduled matches, no players), it’s deleted immediately
  • Error: If the team is referenced in matches or has players, you’ll see an error message. You must remove these dependencies first.

Validation Rules

The system enforces the following rules when creating or editing teams:
Regular Expression: ^(?![0-9]+$)[a-zA-ZÀ-ÿ\d\s]+$
  • Required: Yes
  • Minimum Length: 3 characters
  • Maximum Length: 50 characters
  • Allowed Characters: Letters (including accented characters), numbers, and spaces
  • Restriction: Cannot be only numbers
  • Uniqueness: No duplicate team names allowed
Error Messages:
  • “El nombre del Equipo es obligatorio” (Team name is required)
  • “El nombre del equipo no puede contener más de 50 caracteres” (Max 50 characters)
  • “El nombre del equipo no puede contener menos de 3 caracteres” (Min 3 characters)
  • “Valor Incorrecto. Solo se permiten letras” (Incorrect value. Only letters allowed)
  • Required: Yes
  • Validation: Must select an existing municipality from the dropdown
  • Prerequisite: At least one municipality must exist in the system
  • Required: Yes
  • Validation: Must select an existing technical director from the dropdown
  • Prerequisite: At least one technical director must exist in the system

Prerequisites for Creating Teams

Before you can create teams, ensure the following entities exist in the system:

Municipalities

At least one municipality must be registered to assign teams to geographic locations.

Technical Directors

At least one technical director must be registered to lead the team.
If these prerequisites are not met, the team creation page will display a warning message indicating what needs to be created first.

Team Relationships

Teams maintain relationships with several other entities:

Municipality Relationship

  • Type: Many-to-One
  • Description: Many teams can belong to one municipality
  • Required: Yes

Technical Director Relationship

  • Type: Many-to-One
  • Description: Many teams can have the same technical director
  • Required: Yes

Players Relationship

  • Type: One-to-Many
  • Description: One team has multiple players
  • Impact on Deletion: Teams with players may have deletion restrictions

Matches Relationship

  • Type: One-to-Many (dual)
  • Description: Teams participate as either home (local) or away (visitante) in matches
  • Impact on Deletion: Teams with scheduled matches cannot be deleted

Common Workflows

Scenario: Adding a new team to the tournament
  1. Ensure municipality and technical director exist
  2. Navigate to Teams > Create New
  3. Enter team name
  4. Select municipality from dropdown
  5. Select technical director from dropdown
  6. Submit form
  7. Team appears in Teams Index

Error Handling

The system provides clear feedback when operations fail:

Duplicate Team Name

If you try to create a team with a name that already exists, you’ll see an error message and remain on the creation page with your input preserved.

Missing Prerequisites

If municipalities or technical directors don’t exist, the creation page displays a warning and may disable the submit button until prerequisites are met.

Deletion Errors

When attempting to delete a team that has dependencies (players or matches), an error flag is set and displayed: “ErrorEliminar = true”. You’ll need to remove dependencies before deletion.

Validation Errors

Each field displays specific error messages when validation fails, guiding you to correct the input.

Player Management

Learn how to add players to your teams

Match Management

Schedule matches between teams

Tournament Overview

Complete tournament management guide

Authentication

Login requirements for team management

Build docs developers (and LLMs) love