Added tournament.active
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:
@@ -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));
|
||||
|
||||
@@ -29,4 +29,6 @@ public class TournamentDto extends AbstractDto {
|
||||
|
||||
private Long courts;
|
||||
|
||||
private Boolean active;
|
||||
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user