package fr.titionfire.ffsaf.data.model;

import fr.titionfire.ffsaf.utils.CompetitionSystem;
import fr.titionfire.ffsaf.utils.RegisterMode;
import io.quarkus.runtime.annotations.RegisterForReflection;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@RegisterForReflection

@Entity
@Table(name = "compet")
public class CompetitionModel {
    @Id
    @Access(AccessType.PROPERTY)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    Long id;

    @Column(name = "system_type")
    CompetitionSystem system;

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "club", referencedColumnName = "id")
    ClubModel club;

    String name;

    String uuid;

    Date date;
    Date todate;

    @Column(columnDefinition = "TEXT")
    String description;
    String adresse;

    Date startRegister;
    Date endRegister;

    RegisterMode registerMode;

    boolean publicVisible;

    @OneToMany(mappedBy = "competition", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    List<RegisterModel> insc;

    List<Long> banMembre = new ArrayList<>();

    String owner;

    String data1;
    String data2;
    String data3;
    String data4;
}
