package fr.titionfire.ffsaf.data.model;

import io.quarkus.runtime.annotations.RegisterForReflection;
import jakarta.persistence.*;
import lombok.*;
import org.eclipse.microprofile.openapi.annotations.media.Schema;

@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@RegisterForReflection

@Entity
@Table(name = "affiliation")
public class AffiliationModel {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Schema(description = "Identifiant de l'affiliation", example = "42")
    Long id;

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

    @Schema(description = "Saison de l'affiliation", example = "2021")
    int saison;
}
