WIP: substitutions
All checks were successful
Gitea/swiss-backend/pipeline/head This commit looks good

This commit is contained in:
2025-09-10 10:35:41 +02:00
parent 2cc188540b
commit d7dee35d6e
3 changed files with 36 additions and 1 deletions

26
TODO
View File

@@ -11,4 +11,28 @@ db update:
round.is_finals_round round.is_finals_round
koppeltabel eventgroup_teams 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;

View File

@@ -195,4 +195,11 @@ public class TournamentController {
return ResponseEntity.noContent().build(); 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)));
}
} }

View File

@@ -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 static class ConflictInDrawException extends RuntimeException {}
private List<Match> tryMatches(List<Team> remainingTeams, Group group) { private List<Match> tryMatches(List<Team> remainingTeams, Group group) {