package fr.titionfire.ffsaf.rest.from;

import fr.titionfire.ffsaf.utils.Genre;
import fr.titionfire.ffsaf.utils.GradeArbitrage;
import fr.titionfire.ffsaf.utils.RoleAsso;
import jakarta.ws.rs.FormParam;
import jakarta.ws.rs.core.MediaType;
import lombok.Getter;
import org.eclipse.microprofile.openapi.annotations.media.Schema;
import org.jboss.resteasy.reactive.PartType;
import org.jboss.resteasy.reactive.multipart.FileUpload;

import java.util.Date;

@Getter
public class FullMemberForm {
    @Schema(description = "L'identifiant du membre.", examples = "1")
    @FormParam("id")
    private String id = null;

    @Schema(description = "Le nom du membre.", examples = "Dupont")
    @FormParam("lname")
    private String lname = null;

    @Schema(description = "Le prénom du membre.", examples = "Jean")
    @FormParam("fname")
    private String fname = null;

    @Schema(description = "L'identifiant du club du membre.", examples = "1")
    @FormParam("club")
    private Long club = null;

    @Schema(description = "Le genre du membre.", examples = "H")
    @FormParam("genre")
    private Genre genre;

    @Schema(description = "Le pays du membre.", examples = "FR")
    @FormParam("country")
    private String country;

    @Schema(description = "La date de naissance du membre.")
    @FormParam("birth_date")
    private Date birth_date = null;

    @Schema(description = "L'adresse e-mail du membre.", examples = "jean.dupont@example.com")
    @FormParam("email")
    private String email;

    @Schema(description = "Le rôle du membre dans l'association.", examples = "MEMBRE")
    @FormParam("role")
    private RoleAsso role;

    @Schema(description = "Le grade d'arbitrage du membre.", examples = "ASSESSEUR")
    @FormParam("grade_arbitrage")
    private GradeArbitrage grade_arbitrage = GradeArbitrage.NA;

    @Schema(description = "La photo du membre.")
    @FormParam("photo_data")
    @PartType(MediaType.APPLICATION_OCTET_STREAM)
    private FileUpload photo_data = null;

    @Override
    public String toString() {
        return "FullMemberForm{" +
                "id='" + id + '\'' +
                ", lname='" + lname + '\'' +
                ", fname='" + fname + '\'' +
                ", club=" + club +
                ", genre=" + genre +
                ", birth_date=" + birth_date +
                ", email='" + email + '\'' +
                ", role=" + role +
                ", grade_arbitrage=" + grade_arbitrage +
                '}';
    }
}
