feat: support decimal on weight
This commit is contained in:
@@ -43,8 +43,8 @@ public class CompetitionGuestModel implements CombModel {
|
||||
|
||||
String country = "fr";
|
||||
|
||||
Integer weight = null;
|
||||
Integer weightReal = null;
|
||||
Float weight = null;
|
||||
Float weightReal = null;
|
||||
|
||||
@ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.PERSIST)
|
||||
@JoinTable(
|
||||
@@ -109,7 +109,7 @@ public class CompetitionGuestModel implements CombModel {
|
||||
return Stream.concat(comb.stream(), guest.stream()).anyMatch(c -> Objects.equals(c, comb_));
|
||||
}
|
||||
|
||||
public Integer getWeight2() {
|
||||
public Float getWeight2() {
|
||||
return (this.weightReal != null) ? this.weightReal : this.weight;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,8 +37,8 @@ public class RegisterModel {
|
||||
@JoinColumn(name = "id_membre")
|
||||
MembreModel membre;
|
||||
|
||||
Integer weight;
|
||||
Integer weightReal;
|
||||
Float weight;
|
||||
Float weightReal;
|
||||
int overCategory = 0;
|
||||
Categorie categorie;
|
||||
|
||||
@@ -61,7 +61,7 @@ public class RegisterModel {
|
||||
)
|
||||
List<CatPresetModel> categoriesInscrites = new ArrayList<>();
|
||||
|
||||
public RegisterModel(CompetitionModel competition, MembreModel membre, Integer weight, int overCategory,
|
||||
public RegisterModel(CompetitionModel competition, MembreModel membre, Float weight, int overCategory,
|
||||
Categorie categorie, ClubModel club) {
|
||||
this.id = new RegisterId(competition.getId(), membre.getId());
|
||||
this.competition = competition;
|
||||
@@ -91,7 +91,7 @@ public class RegisterModel {
|
||||
return Categorie.values()[Math.min(tmp.ordinal() + this.overCategory, Categorie.values().length - 1)];
|
||||
}
|
||||
|
||||
public Integer getWeight2() {
|
||||
public Float getWeight2() {
|
||||
if (weightReal != null)
|
||||
return weightReal;
|
||||
return weight;
|
||||
|
||||
Reference in New Issue
Block a user