package fr.titionfire.ffsaf.domain.entity; import fr.titionfire.ffsaf.data.model.ClubModel; import fr.titionfire.ffsaf.utils.Contact; import io.quarkus.runtime.annotations.RegisterForReflection; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import java.util.Map; @Data @Builder @AllArgsConstructor @RegisterForReflection public class ClubEntity { private long id; private String name; private String clubId; private String country; private String shieldURL; private Map contact; private String training_location; private String training_day_time; private String contact_intern; private String RNA; private String SIRET; private String no_affiliation; private boolean international; public static ClubEntity fromModel (ClubModel model) { if (model == null) { return null; } return ClubEntity.builder() .id(model.getId()) .name(model.getName()) .clubId(model.getClubId()) .country(model.getCountry()) .shieldURL(model.getShieldURL()) .contact(model.getContact()) .training_location(model.getTraining_location()) .training_day_time(model.getTraining_day_time()) .contact_intern(model.getContact_intern()) .RNA(model.getRNA()) .SIRET(model.getSIRET()) .no_affiliation(model.getNo_affiliation()) .international(model.isInternational()) .build(); } public ClubModel toModel () { return new ClubModel(this.id, this.clubId, this.name, this.country, this.shieldURL, this.contact, this.training_location, this.training_day_time, this.contact_intern, this.RNA, this.SIRET, this.no_affiliation, this.international); } }