package fr.titionfire.ffsaf.rest.data;

import fr.titionfire.ffsaf.data.model.ClubModel;
import io.quarkus.runtime.annotations.RegisterForReflection;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.eclipse.microprofile.openapi.annotations.media.Schema;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@RegisterForReflection
public class SimpleClubList {
    @Schema(description = "Identifiant du club", example = "1")
    Long id;
    @Schema(description = "Nom du club", example = "Club de test")
    String name;
    @Schema(description = "Pays du club", example = "FR")
    String country;
    @Schema(description = "Numéro SIRET ou RNA du club", example = "12345678901234")
    String state_id;
    @Schema(description = "Numéro d'affiliation du club", example = "12345")
    Long no_affiliation;

    public static SimpleClubList fromModel(ClubModel model) {
        if (model == null)
            return null;

        return new SimpleClubList(model.getId(), model.getName(), model.getCountry(), model.getStateId(),
                model.getNo_affiliation());
    }
}
