mirror of
https://github.com/PaulReichmuth/timekeep-backend.git
synced 2026-02-06 04:53:25 +00:00
Fixed key serialization bug by using team UUID instead of Team Object
This commit is contained in:
@@ -26,7 +26,7 @@ public class Station {
|
|||||||
private Set<Team> passedTeams;
|
private Set<Team> passedTeams;
|
||||||
|
|
||||||
@ElementCollection
|
@ElementCollection
|
||||||
private Map<Team, LocalDate> passingTimes;
|
private Map<UUID, LocalDate> passingTimes;
|
||||||
|
|
||||||
public Station(String name, String location){
|
public Station(String name, String location){
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@@ -40,13 +40,13 @@ public class Station {
|
|||||||
if(!passedTeams.add(team)){
|
if(!passedTeams.add(team)){
|
||||||
throw new TeamExistsException("Team %s was already seen at this Station: %s".formatted(team.getTeamName(), this.location), team);
|
throw new TeamExistsException("Team %s was already seen at this Station: %s".formatted(team.getTeamName(), this.location), team);
|
||||||
}
|
}
|
||||||
passingTimes.put(team, LocalDate.now());
|
passingTimes.put(team.getId(), LocalDate.now());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removePassedTeam(Team team){
|
public void removePassedTeam(Team team){
|
||||||
if (!passedTeams.contains(team)) throw new TeamNotFoundException("Team %s was never seen at this station: %s".formatted(team.getTeamName(), this.location));
|
if (!passedTeams.contains(team)) throw new TeamNotFoundException("Team %s was never seen at this station: %s".formatted(team.getTeamName(), this.location));
|
||||||
passedTeams.remove(team);
|
passedTeams.remove(team);
|
||||||
passingTimes.remove(team);
|
passingTimes.remove(team.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String setPasswordHash(String passwordHash){
|
public String setPasswordHash(String passwordHash){
|
||||||
|
|||||||
Reference in New Issue
Block a user