package fr.titionfire.ffsaf.domain.entity;

import fr.titionfire.ffsaf.data.model.CardboardModel;
import io.quarkus.runtime.annotations.RegisterForReflection;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
@RegisterForReflection
public class CardboardEntity {
    long comb_id;
    long match_id;
    long compet_id;

    int red;
    int yellow;

    public static CardboardEntity fromModel(CardboardModel model) {
        return new CardboardEntity(model.getComb().getId(), model.getMatch().getId(), model.getCompet().getId(),
                model.getRed(), model.getYellow());
    }
}
