Thibaut Valentin dedae02676
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 10m6s
feat: rework competition perm, naming, competition data
2025-08-17 22:07:12 +02:00

37 lines
1.1 KiB
Java

package fr.titionfire.ffsaf.rest.data;
import fr.titionfire.ffsaf.data.model.MatchModel;
import fr.titionfire.ffsaf.utils.ScoreEmbeddable;
import io.quarkus.runtime.annotations.RegisterForReflection;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.List;
@Data
@AllArgsConstructor
@RegisterForReflection
public class MatchData {
private Long id;
private Long c1_id;
private String c1_str;
private Long c2_id;
private String c2_str;
private Long category;
private long category_ord;
private boolean isEnd = true;
private char poule;
private List<ScoreEmbeddable> scores;
public static MatchData fromModel(MatchModel model) {
if (model == null)
return null;
return new MatchData(model.getSystemId(),
(model.getC1_id() == null) ? null : model.getC1_id().getId(), model.getC1_str(),
(model.getC2_id() == null) ? null : model.getC2_id().getId(), model.getC2_str(),
model.getCategory().getId(), model.getCategory_ord(), model.isEnd(), model.getPoule(),
model.getScores());
}
}