package com.datarecovery.master.data.api.bean;

import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;

import com.datarecovery.master.BR;
import com.datarecovery.master.module.member.MemberType;
import com.google.gson.annotations.SerializedName;

import java.util.Objects;

public class MemberGoodsBean extends BaseObservable {
    @SerializedName("id")
    private int id;
    @SerializedName("name")
    private String name;
    @SerializedName("auths")
    private String auths;
    @SerializedName("amount")
    private int amount;
    @SerializedName("originalAmount")
    private int originalAmount;
    @SerializedName("sort")
    private int sort;
    @SerializedName("description")
    private String description;

    @SerializedName("popular")
    private boolean popular;

    private boolean isSelect;

    private String[] scenesArray;

    @Bindable
    public boolean isSelect() {
        return isSelect;
    }

    public void setSelect(boolean select) {
        isSelect = select;
        notifyPropertyChanged(BR.select);
    }

    public void setScenesArray(String[] scenesArray) {
        this.scenesArray = scenesArray;
    }


    public String[] getScenesArray() {
        return scenesArray;
    }

    public boolean isPopular() {
        return popular;
    }

    public int getSort() {
        return sort;
    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getAuths() {
        return auths;
    }

    public int getAmount() {
        return amount;
    }

    public float getRMBAmount() {
        return (float) (amount / 100.0);
    }

    public float getOriginalAmount() {
        return originalAmount / 100f;
    }


    public String getDescription() {
        return description;
    }

    public boolean isSuperRecover() {
        return Objects.equals(auths, MemberType.APP_SUPER_RECOVER);
    }

}
