Invallers
All checks were successful
Gitea/swiss-backend/pipeline/head This commit looks good

This commit is contained in:
2025-09-17 08:58:45 +02:00
parent da7ea66d3e
commit b4bbefff46
6 changed files with 34 additions and 15 deletions

View File

@@ -6,6 +6,7 @@ import nl.connectedit.swiss.domain.TournamentStatus;
import nl.connectedit.swiss.domain.entity.Tournament;
import nl.connectedit.swiss.dto.ResultDto;
import nl.connectedit.swiss.dto.TournamentDto;
import nl.connectedit.swiss.dto.TournamentPlayerSubstitutionDto;
import nl.connectedit.swiss.dto.TournamentValidationDto;
import nl.connectedit.swiss.mapper.TournamentMapper;
import nl.connectedit.swiss.mapper.TournamentValidationMapper;
@@ -196,10 +197,10 @@ public class TournamentController {
return ResponseEntity.noContent().build();
}
@PostMapping("/tournaments/{tournamentId}/players/{playerId}/event/{eventId}/substitute/{substituteId}")
public ResponseEntity<TournamentDto> substitutePlayer(@PathVariable Long tournamentId, @PathVariable Long playerId, @PathVariable Long eventId, @PathVariable Long substituteId) {
@PostMapping("/tournaments/{tournamentId}/players/{playerId}/substitutions")
public ResponseEntity<TournamentDto> substitutePlayer(@PathVariable Long tournamentId, @PathVariable Long playerId, @RequestBody TournamentPlayerSubstitutionDto[] substitutions) {
var tournament = tournamentService.findTournamentById(tournamentId);
return ResponseEntity.ok(tournamentMapper.toDto(tournamentPlayService.substitutePlayer(tournament, eventId, playerId, substituteId)));
return ResponseEntity.ok(tournamentMapper.toDto(tournamentPlayService.playerSubstitutions(tournament, playerId, substitutions)));
}
}