package premium_store.controller.DTO;

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

import java.util.List;

//класс, который соединяет танки клиента в одну строчку (нам так захотелось)
public class SupportClientDTO {
    private long id;
    private String nickName;
    private String email;
    private Integer balance;
    private Long tankId;

    public SupportClientDTO(){ }

    public SupportClientDTO(GameClient gameClient){
        this.id = gameClient.getId();
        this.nickName = gameClient.getNickName();
        this.email = gameClient.getEmail();
        this.balance = gameClient.getBalance();

        if(gameClient.getTanks().size() >= 1){
            this.tankId = gameClient.getTanks().get(gameClient.getTanks().size() - 1).getId();
        }
        else {
            this.tankId = null;
        }
    }

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

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

    public String getNickName(){
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getEmail(){
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getBalance(){
        return balance;
    }

    public void setBalance(Integer balance) {
        this.balance = balance;
    }

    public Long getTankId(){
        return tankId;
    }

    public void setTankId(Long tankId) {
        this.tankId = tankId;
    }
}