WIP: substitutions
All checks were successful
Gitea/swiss-backend/pipeline/head This commit looks good
All checks were successful
Gitea/swiss-backend/pipeline/head This commit looks good
This commit is contained in:
@@ -195,4 +195,11 @@ public class TournamentController {
|
||||
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
|
||||
@PostMapping("/tournaments/{tournamentId}/players/{playerId}/substitute/{substituteId}")
|
||||
public ResponseEntity<TournamentDto> substitutePlayer(@PathVariable Long tournamentId, @PathVariable Long playerId, @PathVariable Long substituteId) {
|
||||
var tournament = tournamentService.findTournamentById(tournamentId);
|
||||
|
||||
return ResponseEntity.ok(tournamentMapper.toDto(tournamentPlayService.substitutePlayer(tournament, playerId, substituteId)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,6 +183,10 @@ public class TournamentPlayService {
|
||||
}
|
||||
}
|
||||
|
||||
public Tournament substitutePlayer(Tournament tournament, Long playerId, Long substituteId) {
|
||||
return tournament;
|
||||
}
|
||||
|
||||
private static class ConflictInDrawException extends RuntimeException {}
|
||||
|
||||
private List<Match> tryMatches(List<Team> remainingTeams, Group group) {
|
||||
|
||||
Reference in New Issue
Block a user