package com.gingersoft.gsa.cloud.base.common.bean;

import android.text.TextUtils;

import java.io.Serializable;

import lombok.Data;

/**
 * 作者：ELEGANT_BIN
 * 版本：1.6.0
 * 创建日期：2020-07-25
 * 修订历史：2020-07-25
 * 描述：
 */
@Data
public class MemberInfo implements Serializable {

    /**
     * ablediscount : 0
     * birthdaybonusratio : 1
     * birthdayperiod : 5
     * brCouponNum : 0
     * brCouponTypeId : 0
     * brPoints : 5
     * brandId : 0
     * brandName : Gingersoft
     * couponTypeId : 0
     * createBy : H5
     * createTime : {"date":28,"day":4,"hours":17,"minutes":53,"month":4,"seconds":37,"time":1590659617000,"timezoneOffset":-480,"year":120}
     * createTimes : 0
     * creditPoints : 0
     * discount : 0
     * expireAfterDayClearPoints : 0
     * extendExpireAmount : 1
     * extendExpirePeriod : 365
     * extendValidDays : 0
     * foodDesc1 : GS白金會員
     * foodDesc2 : GS白金會員
     * foodDesc3 : GS白金會員
     * foodPrice : 500
     * groupId : 7
     * id : 421439
     * isDisplay : 0
     * isVisible : 1
     * isdefault : 1
     * language : 0
     * level : 0
     * levelDesc : 60日內消費滿3000, 可升級為白金會員享有更多折扣會員享有更多折扣
     * levelName :
     * levelName1 : GS基本用戶
     * levelName2 : 基本用戶
     * levelName3 : 基本用戶
     * levelUpAmount : 1
     * levelUpPeriod : 365
     * negativePoints : 0
     * newCouponNum : 0
     * nextDownLevel : 35
     * nextUpLevel : 0
     * optTime : {"date":25,"day":6,"hours":9,"minutes":48,"month":6,"seconds":50,"time":1595641730781,"timezoneOffset":-480,"year":120}
     * optTimes : 0
     * pointRedeemCash : 20
     * pointRule : 2
     * pointUnit : 1
     * pointenddate :
     * pointoveryear : 0
     * points : 0
     * pointsVariable : 50
     * restaurantId : 2
     * scCharge : 0
     * seq1 : 3
     * sid :
     * updateBy : H5
     * updateTime : {"date":23,"day":4,"hours":17,"minutes":33,"month":6,"seconds":14,"time":1595496794000,"timezoneOffset":-480,"year":120}
     * updateTimes : 0
     * vaildDays : 0
     * adverHeight : 0
     * advertCol : 1
     * birthday :
     * birthdays :
     * brandImgUrl : http://m.ricepon.com/1/20160816/20160816133220847.png
     * brandMemberInfoIcon : http://m.ricepon.com/ricepon-asset/images/1546398451087.png
     * consumeAmount : 0
     * consumePoints : 3
     * countryId : 0
     * districtId : 0
     * districtName :
     * email :
     * emailActive : 0
     * headImg :
     * imgPath :
     * isPush : 0
     * levelImgUrl : http://m.ricepon.com/ricepon-asset/201912/member/member-1575525134386.jpg
     * levelTime :
     * memberDiscount : 20
     * memberExpireDate : {"date":25,"day":6,"hours":9,"minutes":48,"month":6,"seconds":50,"time":1595641730781,"timezoneOffset":-480,"year":120}
     * memberId : 0
     * memberName :
     * memberNo : 2005149175337
     * memberNote :
     * memberPoint : 3
     * memberTypeId : 32
     * openId :
     * password :
     * phone : 18218743523
     * postcardNo :
     * postcardType : 1
     * proId : 0
     * proName :
     * secretKey :
     * serviceOpenId :
     * sex : 0
     * shopCanUse :
     * shopId :
     * shopNote :
     * source : 0
     * status : 0
     * type : 0
     * vaildTime : {"date":25,"day":6,"hours":9,"minutes":48,"month":6,"seconds":50,"time":1595641730781,"timezoneOffset":-480,"year":120}
     * MemberPoint : 3
     */

    private long id;
    private String memberNo;
    /**會員折扣比例*/
    private int memberDiscount;
    //获取会员信息接口
    private float MemberPoint;
    //开台接口返回
    private float memberPoint;
    private String memberName = "";
    private String levelName3;
    private String levelName2;
    private String levelName1;
    private String levelName;
    private String phone;
    private int birthdaybonusratio;
    private int creditPoints;
    private int birthdayperiod;
    private int extendExpirePeriod;
    private int brCouponTypeId;
    private int levelUpPeriod;
    private int groupId;
    private int seq1;
    private int nextDownLevel;
    private int discount;
    private int language;
    private int points;
    private int negativePoints;
    private int couponTypeId;
    private int isdefault;
    private int pointsVariable;
    private String brandName;
    private int level;
    private int newCouponNum;
    private int isVisible;
    private int isDisplay;
    private int vaildDays;
    private int brandId;
    /**積分兌換現金列*/
    private float pointRedeemCash;
    private int ablediscount;
    private float expireAfterDayClearPoints;
    private double extendExpireAmount;
    private String foodDesc3;
    private int scCharge;
    private int extendValidDays;
    private double levelUpAmount;
    private int optTimes;
    private int updateTimes;
    private String foodDesc1;
    private String foodDesc2;
    private String sid;
    private String pointenddate;
    private String updateBy;
    private int brPoints;
    private String optTime;
    private int createTimes;
    private int brCouponNum;
    private int pointRule;
    private int foodPrice;
    private String createBy;
    private int pointoveryear;
    private String levelDesc;
    private int pointUnit;
    private int nextUpLevel;
    private int restaurantId = 2;
    private CreateTimeBean createTime;
    private UpdateTimeBean updateTime;
    private MemberExpireDateBean memberExpireDate;
    private VaildTimeBean vaildTime;

    public String getLevelName(){
        if(!TextUtils.isEmpty(levelName1)) {
            return levelName1;
        }
        if(!TextUtils.isEmpty(levelName2)) {
            return levelName2;
        }
        if(!TextUtils.isEmpty(levelName3)) {
            return levelName3;
        }
        return "";
    }

    public float getMemberPoint() {
        if (MemberPoint != 0) {
            return MemberPoint;
        }
        if (memberPoint != 0) {
            return memberPoint;
        }
        return 0;
    }



    @Data
    public static class CreateTimeBean implements Serializable{
        /**
         * date : 28
         * day : 4
         * hours : 17
         * minutes : 53
         * month : 4
         * seconds : 37
         * time : 1590659617000
         * timezoneOffset : -480
         * year : 120
         */

        private int date;
        private int day;
        private int hours;
        private int minutes;
        private int month;
        private int seconds;
        private long time;
        private int timezoneOffset;
        private int year;

    }

    @Data
    public static class OptTimeBean  implements Serializable{
        /**
         * date : 25
         * day : 6
         * hours : 9
         * minutes : 48
         * month : 6
         * seconds : 50
         * time : 1595641730781
         * timezoneOffset : -480
         * year : 120
         */

        private int date;
        private int day;
        private int hours;
        private int minutes;
        private int month;
        private int seconds;
        private long time;
        private int timezoneOffset;
        private int year;

    }

    @Data
    public static class UpdateTimeBean  implements Serializable{
        /**
         * date : 23
         * day : 4
         * hours : 17
         * minutes : 33
         * month : 6
         * seconds : 14
         * time : 1595496794000
         * timezoneOffset : -480
         * year : 120
         */

        private int date;
        private int day;
        private int hours;
        private int minutes;
        private int month;
        private int seconds;
        private long time;
        private int timezoneOffset;
        private int year;

    }

    @Data
    public static class MemberExpireDateBean  implements Serializable{
        /**
         * date : 25
         * day : 6
         * hours : 9
         * minutes : 48
         * month : 6
         * seconds : 50
         * time : 1595641730781
         * timezoneOffset : -480
         * year : 120
         */

        private int date;
        private int day;
        private int hours;
        private int minutes;
        private int month;
        private int seconds;
        private long time;
        private int timezoneOffset;
        private int year;

    }

    @Data
    public static class VaildTimeBean  implements Serializable{
        /**
         * date : 25
         * day : 6
         * hours : 9
         * minutes : 48
         * month : 6
         * seconds : 50
         * time : 1595641730781
         * timezoneOffset : -480
         * year : 120
         */

        private int date;
        private int day;
        private int hours;
        private int minutes;
        private int month;
        private int seconds;
        private long time;
        private int timezoneOffset;
        private int year;

    }
}
