feat: cm admin poule editor

This commit is contained in:
2025-12-02 15:58:20 +01:00
parent 6f61db6817
commit bb901392fc
14 changed files with 887 additions and 57 deletions

View File

@@ -63,7 +63,7 @@ public class MatchModel {
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name = "match", referencedColumnName = "id")
List<CardboardModel> cardboard;
List<CardboardModel> cardboard = new ArrayList<>();
public String getC1Name() {
if (c1_id == null)

View File

@@ -7,6 +7,8 @@ import io.quarkus.hibernate.reactive.panache.PanacheRepositoryBase;
import io.smallrye.mutiny.Uni;
import jakarta.enterprise.context.ApplicationScoped;
import java.util.List;
@ApplicationScoped
public class MatchRepository implements PanacheRepositoryBase<MatchModel, Long> {
@@ -16,4 +18,13 @@ public class MatchRepository implements PanacheRepositoryBase<MatchModel, Long>
.invoke(matchModel1 -> matchModel1.setSystemId(matchModel1.getId())))
.chain(this::persist);
}
public Uni<Void> create(List<MatchModel> matchModel) {
matchModel.forEach(model -> model.setSystem(CompetitionSystem.INTERNAL));
return Panache.withTransaction(() -> this.persist(matchModel)
.call(__ -> this.flush())
.invoke(__ -> matchModel.forEach(model -> model.setSystemId(model.getId())))
.map(__ -> matchModel))
.chain(this::persist);
}
}