Added tournament.active
All checks were successful
Gitea/swiss-backend/pipeline/head This commit looks good

This commit is contained in:
2025-08-11 23:50:57 +02:00
parent 46026a2ea3
commit 0b6d15b313
4 changed files with 7 additions and 0 deletions

View File

@@ -49,6 +49,8 @@ public class Tournament extends AbstractEntity {
private Long courts;
private Boolean active;
public void initialize() {
this.events = new ArrayList<>();
this.events.addAll(Event.getBlankEventSet(this));

View File

@@ -29,4 +29,6 @@ public class TournamentDto extends AbstractDto {
private Long courts;
private Boolean active;
}

View File

@@ -32,6 +32,7 @@ public class TournamentMapper implements DtoMapper<Tournament, TournamentDto>, E
.findFirst()
.orElse(TournamentStatus.UPCOMING)
);
tournament.setActive(tournamentDto.getActive());
tournament.setMaxEvents(tournamentDto.getMaxEvents());
tournament.setCostsPerEvent(tournamentDto.getCostsPerEvent());
tournament.setCourts(tournamentDto.getCourts());
@@ -46,6 +47,7 @@ public class TournamentMapper implements DtoMapper<Tournament, TournamentDto>, E
tournamentDto.setName(tournament.getName());
tournamentDto.setDate(tournament.getDate().format(DateTimeFormatter.ofPattern("dd-MM-yyyy")));
tournamentDto.setStatus(tournament.getStatus().name());
tournamentDto.setActive(tournament.getActive());
tournamentDto.setEvents(
tournament.getEvents()
.stream()

View File

@@ -37,6 +37,7 @@ public class TournamentService {
tournament.setMaxEvents(newTournament.getMaxEvents());
tournament.setCostsPerEvent(newTournament.getCostsPerEvent());
tournament.setCourts(newTournament.getCourts());
tournament.setActive(newTournament.getActive());
return tournamentRepository.save(tournament);
}