Overview
Player management allows you to register individual athletes, assign them to teams, designate their playing positions, and manage their jersey numbers. Each player must be associated with a team and a position to participate in the tournament.Player creation, editing, and deletion require authentication. Only logged-in users can manage player rosters.
Player Structure
Every player in the system has the following attributes:- Player Name: Full name of the athlete (3-50 characters, letters only)
- Jersey Number: Unique number on the team (1-99)
- Team Assignment: The team the player belongs to
- Position: The player’s role on the field (e.g., Forward, Defender, Goalkeeper)
Creating a New Player
Access the Create Player Page
Navigate to the Players section and click “Create New Player” or similar action.Requirement: You must be logged in to access this page.
Enter Player Information
Fill in all required fields:Player Name
- Enter the player’s full name
- Only letters and spaces allowed
- Must be 3-50 characters
- Leading and trailing whitespace is automatically trimmed
- Enter a number between 1 and 99
- Must be numeric only
- Each player needs a unique number within their position and team combination
- Select from dropdown list of available teams
- At least one team must exist in the system
- Select the player’s position from available options
- At least one position must exist in the system
Duplicate Validation
The system checks for duplicate players based on:
- Same name
- Same jersey number
- Same position
- Same team
Viewing Players
The Players Index page displays all registered players with their details:- Player name
- Jersey number
- Team assignment
- Position
- Action buttons (View Details, Edit, Delete)
Editing Player Information
Editing players requires authentication.
Select Player to Edit
From the Players Index, click the “Edit” button next to the player you want to modify.
Review Current Information
The edit form displays:
- Current player name
- Current jersey number
- Currently assigned team (pre-selected in dropdown)
- Current position (pre-selected in dropdown)
Make Changes
You can modify any of the player’s attributes:
- Change Name
- Change Jersey Number
- Transfer to Different Team
- Change Position
Update the player’s name while maintaining validation rules (3-50 characters, letters only).
Validate & Save
The system performs the same duplicate validation as creation:
- Checks if another player exists with the same name, number, position, and team
- If validation passes, changes are saved
- If duplicate detected, you see an error and can modify the input
Deleting Players
Validation Rules
The system enforces strict validation to maintain data quality:Player Name Validation
Player Name Validation
Regular Expression:
^(?![0-9]+$)[a-zA-ZÀ-ÿ\s]+$- Required: Yes
- Minimum Length: 3 characters
- Maximum Length: 50 characters
- Allowed Characters: Letters (including accented characters) and spaces
- Restriction: Cannot contain numbers
- Processing: Leading and trailing whitespace is trimmed automatically
- “El nombre del Jugador es obligatorio” (Player name is required)
- “El nombre del jugador no puede contener más de 50 caracteres” (Max 50 characters)
- “El nombre del jugador no puede contener menos de 3 caracteres” (Min 3 characters)
- “Valor Incorrecto. Solo se permiten letras” (Incorrect value. Only letters allowed)
Jersey Number Validation
Jersey Number Validation
Regular Expression:
^(?!a-zA-Z+$)[0-9]+$- Required: Yes
- Allowed Characters: Numbers only
- Range: 1 to 99
- Type: Integer
- “El Número del Jugador es obligatorio” (Jersey number is required)
- “El Número del Jugador debe estar en un rango entre 1 y 99” (Must be between 1-99)
- “Valor Incorrecto. Solo se permiten numeros” (Incorrect value. Only numbers allowed)
Team Assignment Validation
Team Assignment Validation
- Required: Yes
- Type: Foreign key reference to existing team
- Prerequisite: At least one team must exist
- Selection Method: Dropdown menu with all available teams
Position Validation
Position Validation
- Required: Yes
- Type: Foreign key reference to existing position
- Prerequisite: At least one position must exist
- Selection Method: Dropdown menu with all available positions
- Examples: Goalkeeper, Defender, Midfielder, Forward
Duplicate Player Validation
Duplicate Player Validation
A player is considered duplicate if ALL of these match an existing player:
- Same name (exact match)
- Same jersey number
- Same position
- Same team
- Same name on different teams
- Same number in different positions
- Same name in different positions on the same team
Prerequisites for Creating Players
Before adding players, ensure these entities exist:Teams
At least one team must be registered to assign players.If no teams exist, the creation page displays a warning:
equipoExits = falsePositions
At least one position must be defined in the system.If no positions exist, the creation page displays a warning:
posicionesExits = falsePlayer Relationships
Team Relationship
- Type: Many-to-One
- Description: Many players belong to one team
- Required: Yes
- Cardinality: Each player must have exactly one team
Position Relationship
- Type: Many-to-One
- Description: Many players can have the same position
- Required: Yes
- Cardinality: Each player must have exactly one position
Common Workflows
- Add Player to Team
- Transfer Player to New Team
- Change Player Position
- Update Jersey Number
Scenario: Registering a new player for a team
- Ensure team and positions exist in system
- Navigate to Players > Create New
- Enter player name (e.g., “Juan Martinez”)
- Enter jersey number (e.g., 10)
- Select team from dropdown
- Select position (e.g., “Midfielder”)
- Submit form
- Player appears in Players Index
Position Management
Positions are predefined entities in the system that categorize player roles:Position Attributes
- Position Name: 3-30 characters (letters only)
- Players: List of all players assigned to this position
Position Validation
Common Position Types
Typical positions in soccer tournaments include:- Goalkeeper (Arquero)
- Defender (Defensa)
- Midfielder (Mediocampista)
- Forward (Delantero)
Error Handling
Duplicate Player Error
Duplicate Player Error
Condition: When creating/editing a player with name, number, position, and team that exactly match an existing player.Result:
duplicate = true- Form redisplays with error message
- Input is preserved for user correction
- User must modify at least one of the four attributes
Missing Prerequisites Error
Missing Prerequisites Error
Condition: No teams or positions exist in the system.Result:
equipoExits = falseorposicionesExits = false- Warning message displayed on page
- Form may be disabled until prerequisites are created
- User directed to create teams or positions first
Validation Errors
Validation Errors
Condition: Input doesn’t meet validation rules (e.g., name too short, number out of range).Result:
ModelState.IsValid = false- Specific error messages displayed for each invalid field
- Form redisplays with user input preserved
- Dropdowns remain populated with available options
General Exception Handling
General Exception Handling
Condition: Unexpected errors during creation, update, or deletion.Result:
- Exception caught in try-catch block
- Error logged to console
- User returned to form with data preserved
- Available teams and positions reloaded
Data Model
The player entity structure from the source code:Best Practices
Unique Jersey Numbers
While the system allows same numbers for different positions, assign unique numbers per team for clarity.
Consistent Naming
Use full names with proper capitalization for professional appearance.
Position Assignment
Assign positions based on player’s primary role for accurate team organization.
Regular Updates
Keep player information current, especially when transfers or position changes occur.
Related Documentation
Team Management
Learn how to create and manage teams for player assignment
Tournament Overview
Complete tournament management system guide
Match Management
Schedule matches with your registered players
Authentication
Login requirements for player management