package ch.pizzalemon.android.model.history;

import com.google.gson.annotations.SerializedName;

import java.util.ArrayList;

/**
 * Created by cimenmus on 17.01.2018.
 */

public class OrderHistoryProductModel {

    @SerializedName("product_id") private String productId;
    @SerializedName("option") private ArrayList<OrderHistoryProductOptionModel> optionList;
    private String name;
    private String model;
    private String quantity;
    private String price;
    private String total;
    private String reward;

    private void checkNull(){
        if(productId == null){
            productId = "";
        }
        if(name == null){
            name = "";
        }
        if(model == null){
            model = "";
        }
        if(quantity == null){
            quantity = "";
        }
        if(price == null){
            price = "";
        }
        if(total == null){
            total = "";
        }
        if(reward == null){
            reward = "";
        }
        if(optionList == null){
            optionList = new ArrayList<>();
        }
        else{
            OrderHistoryProductOptionModel.checkNull(optionList);
        }
    }

    public static void checkNull(ArrayList<OrderHistoryProductModel> orderHistoryProductModels){
        for(OrderHistoryProductModel orderHistoryProductModel : orderHistoryProductModels){
            orderHistoryProductModel.checkNull();
        }
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public ArrayList<OrderHistoryProductOptionModel> getOptionList() {
        return optionList;
    }

    public void setOptionList(ArrayList<OrderHistoryProductOptionModel> optionList) {
        this.optionList = optionList;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public String getQuantity() {
        return quantity;
    }

    public void setQuantity(String quantity) {
        this.quantity = quantity;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getTotal() {
        return total;
    }

    public void setTotal(String total) {
        this.total = total;
    }

    public String getReward() {
        return reward;
    }

    public void setReward(String reward) {
        this.reward = reward;
    }
}
