package ch.pizzalemon.android.model;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;

/**
 * Created by cimenmus on 26/09/2017.
 */

public class UserModel implements Serializable{

    @Expose @SerializedName("customer_id") private String id;
    @Expose @SerializedName("address_id") private String addressId;
    @Expose @SerializedName("pizza_pass_count") private String pizzapassCount;
    private String firstname;
    private String lastname;
    private String email;
    private String telephone;
    private CustomerTokenModel token;

    public void checkNull(){

        if(id == null)
            id = "";

        if(addressId == null)
            addressId = "";

        if(firstname == null)
            firstname = "";

        if(lastname == null)
            lastname = "";

        if(email == null)
            email = "";

        if(telephone == null)
            telephone = "";

        if(pizzapassCount == null)
            pizzapassCount = "0";

        if(token != null)
            token.checkNull();
    }

    public String getFullname(){
        return firstname + " " + lastname;
    }

    public String getId() {
        return id;
    }

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

    public String getAddressId() {
        return addressId;
    }

    public void setAddressId(String addressId) {
        this.addressId = addressId;
    }

    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public String getLastname() {
        return lastname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    public String getEmail() {
        return email;
    }

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

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public CustomerTokenModel getToken() {
        return token;
    }

    public void setToken(CustomerTokenModel token) {
        this.token = token;
    }

    public String getPizzapassCount() {
        return pizzapassCount;
    }

    public void setPizzapassCount(String pizzapassCount) {
        this.pizzapassCount = pizzapassCount;
    }
}
