package premium_store.controller.DTO;

import com.fasterxml.jackson.annotation.JsonProperty;
import premium_store.model.Nation;

import java.util.List;

public class FullNationDTO {
    public Long id;
    public String nation;
    public List<TankDTO> tanks;

    public FullNationDTO(){ }

    public FullNationDTO(Nation nation){
        this.id = nation.getId();
        this.nation = nation.getNation();
        this.tanks = nation.getTanksOfThisNation().stream()
                .map(TankDTO::new)
                .toList();
    }

    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getNation() {
        return nation;
    }

    public void setNation(String nation) {
        this.nation = nation;
    }

    public List<TankDTO> getTanksOfThisNation() {
        return tanks;
    }

    public void setTanks(List<TankDTO> tanks) {
        this.tanks = tanks;
    }
}
