feat: add selection
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 6m50s
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 6m50s
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package fr.titionfire.ffsaf.rest.data;
|
||||
|
||||
import fr.titionfire.ffsaf.data.model.SelectionModel;
|
||||
import fr.titionfire.ffsaf.utils.Categorie;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.eclipse.microprofile.openapi.annotations.media.Schema;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@RegisterForReflection
|
||||
public class SimpleSelection {
|
||||
@Schema(description = "ID de la séléction", examples = "1")
|
||||
Long id;
|
||||
@Schema(description = "ID du membre", examples = "1")
|
||||
Long membre;
|
||||
@Schema(description = "Saison de la séléction", examples = "2024")
|
||||
int saison;
|
||||
@Schema(description = "Catégorie de la séléction", examples = "JUNIOR")
|
||||
Categorie categorie;
|
||||
|
||||
public static SimpleSelection fromModel(SelectionModel model) {
|
||||
if (model == null)
|
||||
return null;
|
||||
|
||||
return new SimpleSelection.SimpleSelectionBuilder()
|
||||
.id(model.getId())
|
||||
.membre(model.getMembre().getId())
|
||||
.saison(model.getSaison())
|
||||
.categorie(model.getCategorie())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user