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:
26
TODO
26
TODO
@@ -11,4 +11,28 @@ db update:
|
||||
|
||||
round.is_finals_round
|
||||
koppeltabel eventgroup_teams
|
||||
tournament.active
|
||||
tournament.active
|
||||
|
||||
set search_path to swiss;
|
||||
|
||||
ALTER TABLE match
|
||||
ADD counter_id bigint;
|
||||
|
||||
;
|
||||
|
||||
ALTER TABLE round
|
||||
ADD is_finals_round boolean;
|
||||
|
||||
ALTER TABLE round
|
||||
ADD is_final_round boolean DEFAULT (false);
|
||||
|
||||
;
|
||||
|
||||
ALTER TABLE tournament_player
|
||||
ADD counting boolean;
|
||||
|
||||
ALTER TABLE tournament_player
|
||||
ADD counts bigint;
|
||||
|
||||
UPDATE tournament_player SET counting = false;
|
||||
UPDATE tournament_player SET counts = 0;
|
||||
@@ -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