package fr.titionfire.ffsaf.net2.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;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@RegisterForReflection
public class SimpleClubModel {
    Long id;
    String name;
    String country;
    String shieldURL;

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

        return new SimpleClubModel(model.getId(), model.getName(), model.getCountry(),
                "/api/club/" + model.getClubId() + "/logo");
    }
}
