feat: add category registration system to admin

This commit is contained in:
2026-01-20 19:05:23 +01:00
parent 4dff0940c1
commit a5d3973394
22 changed files with 941 additions and 180 deletions

View File

@@ -0,0 +1,71 @@
package fr.titionfire.ffsaf.data.model;
import fr.titionfire.ffsaf.utils.Categorie;
import io.quarkus.runtime.annotations.RegisterForReflection;
import jakarta.persistence.*;
import lombok.*;
import java.util.ArrayList;
import java.util.List;
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@RegisterForReflection
@Entity
@Table(name = "category_preset")
public class CatPresetModel {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "competition", referencedColumnName = "id")
CompetitionModel competition;
String name = "";
List<Categorie> categories;
long roundDuration;
long pauseDuration;
SwordType swordType = SwordType.NONE;
ShieldType shieldType = ShieldType.NONE;
/* Bitmask protections:
* 1 - 1 - Head
* 2 - 2 - Throat
* 3 - 4 - Torso
* 4 - 8 - Arms
* 5 - 16 - Hands
* 6 - 32 - Groin
* 7 - 64 - Legs
*/
int mandatoryProtection = 0;
@ManyToMany(mappedBy = "categoriesInscrites", fetch = FetchType.LAZY)
private List<RegisterModel> registers = new ArrayList<>();
@ManyToMany(mappedBy = "categoriesInscrites", fetch = FetchType.LAZY)
private List<CompetitionGuestModel> guest = new ArrayList<>();
public enum SwordType {
NONE,
ONE_HAND,
TWO_HAND,
SABER
}
public enum ShieldType {
NONE,
STANDARD,
ROUND,
TEARDROP,
BUCKLER
}
}