Overview
Match management allows you to schedule games between registered teams, set match dates and times, and record scores for both home and away teams. The system tracks all matches in the tournament with complete details about participating teams and results.Creating, editing, and deleting matches requires authentication. Only logged-in users can manage match schedules.
Match Structure
Every match in the system contains:- Date and Time: When the match is scheduled to take place
- Home Team (Local): The team playing at their home venue
- Away Team (Visitante): The visiting team
- Home Score (Marcador Local): Goals scored by the home team (0-100)
- Away Score (Marcador Visitante): Goals scored by the away team (0-100)
Creating a New Match
Access the Create Match Page
Navigate to the Matches section and click “Create New Match” or similar action.Requirement: You must be logged in to access this page.Prerequisite: At least 2 teams must exist in the system to schedule a match.
Select Match Date and Time
Choose when the match will take place:
- Required: Yes, date and time are mandatory
- Format: DateTime field with date and time picker
- Validation: Cannot be empty
Select Home Team (Local)
Choose the team that will play at home:
- Select from dropdown of all registered teams
- This team’s venue is considered the match location
- Will be displayed as “Local” in match listings
Select Away Team (Visitante)
Choose the visiting team:
- Select from dropdown of all registered teams
- Can be any team except the home team
- Will be displayed as “Visitante” in match listings
Enter Match Scores
Record the final scores for both teams:Home Score (Marcador Local)
- Required field
- Must be between 0 and 100
- Numeric values only
- Required field
- Must be between 0 and 100
- Numeric values only
You can create matches with scores of 0-0 for scheduling future games, then edit to update scores after the match is played.
Viewing Matches
The Matches Index page displays all scheduled matches:Match List Display
Each match shows:- Date and time of the match
- Home team (Local) name
- Home team score
- Away team (Visitante) name
- Away team score
- Action buttons (View Details, Edit, Delete)
Typical Display Format
Editing Match Details
Editing matches requires authentication.
Select Match to Edit
From the Matches Index, click the “Edit” button next to the match you want to modify.
Review Current Information
The edit form displays:
- Current date and time
- Currently selected home team (pre-selected in dropdown)
- Current home score
- Currently selected away team (pre-selected in dropdown)
- Current away score
Make Changes
You can modify any match attribute:
- Reschedule Match
- Change Teams
- Update Scores
- Complete Update
Update the date and time to reschedule the game to a different slot.
Duplicate Validation
The system checks for duplicate matches:
- If another match exists with the same home team, away team, and exact date/time
- If duplicate detected, you see an error message
- Modify at least one field to make the match unique
Deleting Matches
Validation Rules
Date and Time Validation
Date and Time Validation
Display Name: “Fecha y hora del partido” (Match date and time)
- Required: Yes
- Type: DateTime
- Format: Full date and time
- Null Handling: Cannot be null or empty
- “La fecha del partido es obligatoria” (Match date is required)
Home Team (Local) Validation
Home Team (Local) Validation
- Required: Yes
- Type: Foreign key reference to Team entity
- Selection: Dropdown with all available teams
- Relationship: One match has one home team
Home Score (Marcador Local) Validation
Home Score (Marcador Local) Validation
Display Name: “Marcador Local”
- Required: Yes
- Type: Integer
- Range: 0 to 100
- Minimum: 0 (no negative scores)
- Maximum: 100 (upper limit for data integrity)
- “El Marcador Local es obligatorio” (Home score is required)
- “Marcador Local debe estar en un rango entre 0 y 100” (Score must be 0-100)
Away Team (Visitante) Validation
Away Team (Visitante) Validation
- Required: Yes
- Type: Foreign key reference to Team entity
- Selection: Dropdown with all available teams
- Relationship: One match has one away team
Away Score (Marcador Visitante) Validation
Away Score (Marcador Visitante) Validation
Display Name: “Marcador Visitante”
- Required: Yes
- Type: Integer
- Range: 0 to 100
- Minimum: 0 (no negative scores)
- Maximum: 100 (upper limit for data integrity)
- “El Marcador Visitante es obligatoria” (Away score is required)
- “Marcador Visitante debe estar en un rango entre 0 y 100” (Score must be 0-100)
Duplicate Match Validation
Duplicate Match Validation
A match is considered duplicate if ALL of these match an existing match:
- Same home team (Local)
- Same away team (Visitante)
- Same exact date and time
- Same teams playing at different times
- Different teams playing at the same time
- Rematch between teams on different dates
Prerequisites for Creating Matches
Minimum Two Teams Required
At least 2 teams must be registered in the system before you can schedule a match.Validation:
equiposExits = equipos.Count() >= 2 ? true : falseIf fewer than 2 teams exist, the creation page displays a warning and may disable match creation.Match Relationships
Home Team Relationship
- Property:
Local - Type: Many-to-One
- Description: Many matches can have the same home team
- Required: Yes
- Inverse Property: Team has
PartidosLocalcollection
Away Team Relationship
- Property:
Visitante - Type: Many-to-One
- Description: Many matches can have the same away team
- Required: Yes
- Inverse Property: Team has
PartidosVisitantecollection
Common Workflows
- Schedule Future Match
- Record Match Results
- Reschedule Match
- Create Match with Results
Scenario: Planning a match that hasn’t been played yet
- Navigate to Matches > Create New
- Select future date and time
- Choose home team
- Choose away team
- Enter 0 for both scores (or leave as default)
- Submit form
- Match appears in schedule
- Edit later to update scores after match is played
Score Range Explanation
The system allows scores from 0 to 100:- Typical Range: Most soccer matches have scores between 0-10
- Extended Range: The 0-100 range accommodates:
- Standard soccer matches
- Aggregate scores (if tracking tournament totals)
- Unusual high-scoring games
- Data integrity and testing scenarios
While the technical limit is 100, typical soccer matches rarely exceed single digits. The validation exists primarily for data integrity rather than reflecting common game outcomes.
Error Handling
Duplicate Match Error
Duplicate Match Error
Condition: Creating or editing a match with same home team, away team, and date/time as existing match.Result:
duplicate = true- Error message displayed
- Form redisplays with current input preserved
- Team selections remain populated
- User must modify teams or date/time to proceed
Insufficient Teams Error
Insufficient Teams Error
Condition: Fewer than 2 teams exist in the system.Result:
equiposExits = false- Warning message displayed on creation page
- Cannot create match until more teams are registered
- User directed to create teams first
Validation Errors
Validation Errors
Condition: Invalid input (missing date, scores out of range, etc.).Result:
ModelState.IsValid = false- Specific error messages for each invalid field
- Form redisplays with user input
- Dropdowns repopulated with available teams
Deletion Errors
Deletion Errors
Condition: Unable to delete match due to constraints.Result:
ErrorEliminar = true- Error message displayed in Matches Index
- Match remains in system
- Matches list refreshes to show all matches
Data Model
The match entity structure from the source code:Team Match History
Each team maintains relationships to their matches:- All matches where a team played at home
- All matches where a team played away
- Complete match history for each team
- Team performance statistics
Best Practices
Schedule in Advance
Create matches with future dates and 0-0 scores, then update results after games are played.
Verify Teams
Double-check you’ve selected the correct home and away teams before submitting.
Accurate Timing
Enter precise date and time to avoid scheduling conflicts and duplicate detection issues.
Update Promptly
Record match results soon after games are completed for accurate tournament tracking.
Related Documentation
Team Management
Create and manage teams that participate in matches
Tournament Overview
Complete tournament management system guide
Player Management
Manage players on teams that compete in matches
Authentication
Login requirements for match management