dev #108

Merged
Thibaut merged 9 commits from dev into master 2026-02-20 16:59:40 +00:00
9 changed files with 19 additions and 19 deletions
Showing only changes of commit d857fce71f - Show all commits

View File

@ -43,8 +43,8 @@ public class CompetitionGuestModel implements CombModel {
String country = "fr"; String country = "fr";
Integer weight = null; Float weight = null;
Integer weightReal = null; Float weightReal = null;
@ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.PERSIST) @ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.PERSIST)
@JoinTable( @JoinTable(
@ -109,7 +109,7 @@ public class CompetitionGuestModel implements CombModel {
return Stream.concat(comb.stream(), guest.stream()).anyMatch(c -> Objects.equals(c, comb_)); 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; return (this.weightReal != null) ? this.weightReal : this.weight;
} }
} }

View File

@ -37,8 +37,8 @@ public class RegisterModel {
@JoinColumn(name = "id_membre") @JoinColumn(name = "id_membre")
MembreModel membre; MembreModel membre;
Integer weight; Float weight;
Integer weightReal; Float weightReal;
int overCategory = 0; int overCategory = 0;
Categorie categorie; Categorie categorie;
@ -61,7 +61,7 @@ public class RegisterModel {
) )
List<CatPresetModel> categoriesInscrites = new ArrayList<>(); 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) { Categorie categorie, ClubModel club) {
this.id = new RegisterId(competition.getId(), membre.getId()); this.id = new RegisterId(competition.getId(), membre.getId());
this.competition = competition; this.competition = competition;
@ -91,7 +91,7 @@ public class RegisterModel {
return Categorie.values()[Math.min(tmp.ordinal() + this.overCategory, Categorie.values().length - 1)]; return Categorie.values()[Math.min(tmp.ordinal() + this.overCategory, Categorie.values().length - 1)];
} }
public Integer getWeight2() { public Float getWeight2() {
if (weightReal != null) if (weightReal != null)
return weightReal; return weightReal;
return weight; return weight;

View File

@ -27,7 +27,7 @@ public class CombEntity {
Genre genre; Genre genre;
String country; String country;
int overCategory; int overCategory;
Integer weight; Float weight;
List<CombEntity> teamMembers; List<CombEntity> teamMembers;
List<Long> categoriesInscrites; List<Long> categoriesInscrites;

View File

@ -107,7 +107,7 @@ public class CompetitionData {
public static class SimpleRegister { public static class SimpleRegister {
long id; long id;
int overCategory; int overCategory;
Integer weight; Float weight;
Categorie categorie; Categorie categorie;
Long club; Long club;
String club_str; String club_str;

View File

@ -18,8 +18,8 @@ public class RegisterRequestData {
private String fname; private String fname;
private String lname; private String lname;
private Integer weight; private Float weight;
private Integer weightReal; private Float weightReal;
private Integer overCategory; private Integer overCategory;
private boolean lockEdit = false; private boolean lockEdit = false;
private List<Long> categoriesInscrites; private List<Long> categoriesInscrites;

View File

@ -26,8 +26,8 @@ public class SimpleRegisterComb {
private Categorie categorie; private Categorie categorie;
private SimpleClubModel club; private SimpleClubModel club;
private Integer licence; private Integer licence;
private Integer weight; private Float weight;
private Integer weightReal; private Float weightReal;
private int overCategory; private int overCategory;
private boolean hasLicenceActive; private boolean hasLicenceActive;
private boolean lockEdit; private boolean lockEdit;

View File

@ -86,7 +86,7 @@ public class RTeam {
.max(Integer::compareTo) .max(Integer::compareTo)
.map(i -> Categorie.values()[i]).orElse(Categorie.SENIOR1)); .map(i -> Categorie.values()[i]).orElse(Categorie.SENIOR1));
List<Integer> s = Stream.concat( List<Float> s = Stream.concat(
pair.getKey().stream().map(RegisterModel::getWeight), pair.getKey().stream().map(RegisterModel::getWeight),
pair.getValue().stream().map(CompetitionGuestModel::getWeight)) pair.getValue().stream().map(CompetitionGuestModel::getWeight))
.filter(Objects::nonNull).toList(); .filter(Objects::nonNull).toList();
@ -95,7 +95,7 @@ public class RTeam {
} else if (s.size() == 1) { } else if (s.size() == 1) {
team.setWeight(s.get(0)); team.setWeight(s.get(0));
} else { } else {
team.setWeight((int) s.stream().mapToInt(Integer::intValue) team.setWeight((float) s.stream().mapToDouble(Float::doubleValue)
.average() .average()
.orElse(0)); .orElse(0));
} }

View File

@ -554,11 +554,11 @@ function Modal_({data2, data3, error2, sendRegister, modalState, setModalState,
<div className="input-group mb-3"> <div className="input-group mb-3">
<span className="input-group-text" id="weight">{t('comp.modal.poids')}</span> <span className="input-group-text" id="weight">{t('comp.modal.poids')}</span>
{source === "admin" && <span className="input-group-text" id="weightReal">{t('comp.modal.annoncé')}</span>} {source === "admin" && <span className="input-group-text" id="weightReal">{t('comp.modal.annoncé')}</span>}
<input type="number" min={1} step={1} className="form-control" placeholder="--" aria-label="weight" <input type="number" min={1} step={0.1} className="form-control" placeholder="--" aria-label="weight"
name="weight" aria-describedby="weight" disabled={!(data3.requiredWeight.includes(currenCat))} value={weight} name="weight" aria-describedby="weight" disabled={!(data3.requiredWeight.includes(currenCat))} value={weight}
onChange={e => setWeight(e.target.value)}/> onChange={e => setWeight(e.target.value)}/>
{source === "admin" && <><span className="input-group-text" id="weightReal">{t('comp.modal.pesé')}</span> {source === "admin" && <><span className="input-group-text" id="weightReal">{t('comp.modal.pesé')}</span>
<input type="number" min={1} step={1} className="form-control" placeholder="--" aria-label="weightReal" <input type="number" min={1} step={0.1} className="form-control" placeholder="--" aria-label="weightReal"
name="weightReal" aria-describedby="weightReal" value={weightReal} name="weightReal" aria-describedby="weightReal" value={weightReal}
onChange={e => setWeightReal(e.target.value)}/></>} onChange={e => setWeightReal(e.target.value)}/></>}
</div> </div>

View File

@ -156,11 +156,11 @@ function SelfRegister({data2}) {
<h4 style={{textAlign: "left"}}>{t('comp.monInscription')}</h4> <h4 style={{textAlign: "left"}}>{t('comp.monInscription')}</h4>
<div className="input-group mb-3" hidden={!(data2?.requiredWeight.includes(currenCat))}> <div className="input-group mb-3" hidden={!(data2?.requiredWeight.includes(currenCat))}>
<span className="input-group-text" id="weight">{t("comp.modal.poids")}</span> <span className="input-group-text" id="weight">{t("comp.modal.poids")}</span>
<input type="number" min={1} step={1} className="form-control" placeholder="--" aria-label="weight" disabled={disabled} <input type="number" min={1} step={0.1} className="form-control" placeholder="--" aria-label="weight" disabled={disabled}
name="weight" aria-describedby="weight" value={weight} onChange={e => setWeight(e.target.value)}/> name="weight" aria-describedby="weight" value={weight} onChange={e => setWeight(e.target.value)}/>
{data[0]?.weightReal && <> {data[0]?.weightReal && <>
<span className="input-group-text" id="weight">{t("comp.modal.pesé")}</span> <span className="input-group-text" id="weight">{t("comp.modal.pesé")}</span>
<input type="number" min={1} step={1} className="form-control" placeholder="--" aria-label="weight" disabled={true} <input type="number" min={1} step={0.1} className="form-control" placeholder="--" aria-label="weight" disabled={true}
name="weight" aria-describedby="weight" value={data[0]?.weightReal} onChange={() => { name="weight" aria-describedby="weight" value={data[0]?.weightReal} onChange={() => {
}}/> }}/>
</>} </>}