Add team create and retrieve functionalities #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several new features and improvements related to team management, including a new controller, service, and repository for handling teams, as well as changes to existing exception handling. The most important changes include the creation of the
TeamController
,TeamService
, andTeamRepository
classes, the introduction of a newTeamCreationRequest
DTO, and adjustments to the exception handling mechanism.New Features:
src/main/java/com/luka/levi9/controller/TeamController.java
: AddedTeamController
to handle team-related HTTP requests, including endpoints for creating and retrieving teams.src/main/java/com/luka/levi9/service/TeamService.java
: IntroducedTeamService
to manage the business logic for creating and retrieving teams, including validation of team creation requests.src/main/java/com/luka/levi9/repository/TeamRepository.java
: CreatedTeamRepository
to interact with the database for team-related operations.Data Transfer Objects (DTOs):
src/main/java/com/luka/levi9/dto/TeamCreationRequest.java
: AddedTeamCreationRequest
DTO to encapsulate the data required for creating a new team, including team name and player IDs.Exception Handling:
src/main/java/com/luka/levi9/exception/NotFoundException.java
: RenamedPlayerNotFoundException
toNotFoundException
to generalize the exception for both players and teams.src/main/java/com/luka/levi9/exception/TeamValidationException.java
: AddedTeamValidationException
to handle validation errors specific to team creation.These changes collectively enhance the application's ability to manage teams and improve the robustness of exception handling.