wip: club

This commit is contained in:
2024-07-11 23:02:29 +02:00
parent d5b4820c79
commit 76d7a28678
33 changed files with 1346 additions and 227 deletions

View File

@@ -0,0 +1,4 @@
package fr.titionfire.ffsaf.rest.from;
public class AffiliationForm {
}

View File

@@ -1,6 +1,7 @@
package fr.titionfire.ffsaf.rest.from;
import fr.titionfire.ffsaf.data.model.AffiliationRequestModel;
import fr.titionfire.ffsaf.utils.RoleAsso;
import jakarta.ws.rs.FormParam;
import jakarta.ws.rs.core.MediaType;
import lombok.Getter;
@@ -14,7 +15,7 @@ public class AffiliationRequestForm {
private String name = null;
@FormParam("siren")
private String siren = null;
private Long siren = null;
@FormParam("rna")
private String rna = null;
@@ -30,32 +31,38 @@ public class AffiliationRequestForm {
@PartType(MediaType.APPLICATION_OCTET_STREAM)
private byte[] logo = new byte[0];
@FormParam("president-nom")
private String president_lname = null;
@FormParam("president-prenom")
private String president_fname = null;
@FormParam("president-mail")
private String president_email = null;
@FormParam("president-licence")
private String president_lincence = null;
@FormParam("m1_nom")
private String m1_lname = null;
@FormParam("m1_prenom")
private String m1_fname = null;
@FormParam("m1_mail")
private String m1_email = null;
@FormParam("m1_licence")
private String m1_lincence = null;
@FormParam("m1_role")
private RoleAsso m1_role = null;
@FormParam("tresorier-nom")
private String tresorier_lname = null;
@FormParam("tresorier-prenom")
private String tresorier_fname = null;
@FormParam("tresorier-mail")
private String tresorier_email = null;
@FormParam("tresorier-licence")
private String tresorier_lincence = null;
@FormParam("m2_nom")
private String m2_lname = null;
@FormParam("m2_prenom")
private String m2_fname = null;
@FormParam("m2_mail")
private String m2_email = null;
@FormParam("m2_licence")
private String m2_lincence = null;
@FormParam("m2_role")
private RoleAsso m2_role = null;
@FormParam("secretaire-nom")
private String secretaire_lname = null;
@FormParam("secretaire-prenom")
private String secretaire_fname = null;
@FormParam("secretaire-mail")
private String secretaire_email = null;
@FormParam("secretaire-licence")
private String secretaire_lincence = null;
@FormParam("m3_nom")
private String m3_lname = null;
@FormParam("m3_prenom")
private String m3_fname = null;
@FormParam("m3_mail")
private String m3_email = null;
@FormParam("m3_licence")
private String m3_lincence = null;
@FormParam("m3_role")
private RoleAsso m3_role = null;
public AffiliationRequestModel toModel() {
AffiliationRequestModel model = new AffiliationRequestModel();
@@ -64,23 +71,26 @@ public class AffiliationRequestForm {
model.setRNA(this.getRna());
model.setAddress(this.getAdresse());
model.setPresident_lname(this.getPresident_lname());
model.setPresident_fname(this.getPresident_fname());
model.setPresident_email(this.getPresident_email());
model.setPresident_lincence((this.getPresident_lincence() == null || this.getPresident_lincence().isBlank())
? 0 : Integer.parseInt(this.getPresident_lincence()));
model.setM1_lname(this.getM1_lname());
model.setM1_fname(this.getM1_fname());
model.setM1_email(this.getM1_email());
model.setM1_lincence((this.getM1_lincence() == null || this.getM1_lincence().isBlank())
? 0 : Integer.parseInt(this.getM1_lincence()));
model.setM1_role(this.getM1_role());
model.setTresorier_lname(this.getTresorier_lname());
model.setTresorier_fname(this.getTresorier_fname());
model.setTresorier_email(this.getTresorier_email());
model.setTresorier_lincence((this.getPresident_lincence() == null || this.getPresident_lincence().isBlank())
? 0 : Integer.parseInt(this.getTresorier_lincence()));
model.setM2_lname(this.getM2_lname());
model.setM2_fname(this.getM2_fname());
model.setM2_email(this.getM2_email());
model.setM2_lincence((this.getM1_lincence() == null || this.getM1_lincence().isBlank())
? 0 : Integer.parseInt(this.getM2_lincence()));
model.setM2_role(this.getM2_role());
model.setSecretaire_lname(this.getSecretaire_lname());
model.setSecretaire_fname(this.getSecretaire_fname());
model.setSecretaire_email(this.getSecretaire_email());
model.setSecretaire_lincence((this.getPresident_lincence() == null || this.getPresident_lincence().isBlank())
? 0 : Integer.parseInt(this.getSecretaire_lincence()));
model.setM3_lname(this.getM3_lname());
model.setM3_fname(this.getM3_fname());
model.setM3_email(this.getM3_email());
model.setM3_lincence((this.getM1_lincence() == null || this.getM1_lincence().isBlank())
? 0 : Integer.parseInt(this.getM3_lincence()));
model.setM3_role(this.getM3_role());
return model;
}

View File

@@ -0,0 +1,23 @@
package fr.titionfire.ffsaf.rest.from;
import jakarta.ws.rs.FormParam;
import jakarta.ws.rs.core.MediaType;
import lombok.Getter;
import org.jboss.resteasy.reactive.PartType;
@Getter
public class FullClubForm {
@FormParam("id")
private String id = null;
@FormParam("name")
private String name = null;
@FormParam("status")
@PartType(MediaType.APPLICATION_OCTET_STREAM)
private byte[] status = new byte[0];
@FormParam("logo")
@PartType(MediaType.APPLICATION_OCTET_STREAM)
private byte[] logo = new byte[0];
}