package fr.titionfire.ffsaf.domain.entity;

import fr.titionfire.ffsaf.data.model.ClubModel;
import fr.titionfire.ffsaf.utils.Contact;
import io.quarkus.runtime.annotations.RegisterForReflection;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.util.Map;

@Data
@Builder
@AllArgsConstructor
@RegisterForReflection
public class ClubEntity {
    private long id;
    private String name;
    private String clubId;
    private String country;
    private Map<Contact, String> contact;
    private String training_location;
    private String training_day_time;
    private String contact_intern;
    private String StateId;
    private Long no_affiliation;
    private boolean international;

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

        return ClubEntity.builder()
                .id(model.getId())
                .name(model.getName())
                .clubId(model.getClubId())
                .country(model.getCountry())
                .contact(model.getContact())
                .training_location(model.getTraining_location())
                .training_day_time(model.getTraining_day_time())
                .contact_intern(model.getContact_intern())
                .StateId(model.getStateId())
                .no_affiliation(model.getNo_affiliation())
                .international(model.isInternational())
                .build();
    }
}
