/**
 * All rights Reserved, Designed By www.freemud.cn
 *
 * @Title: OrderAccountType
 * @Package cn.freemud.enums
 * @Description:
 * @author: liming.guo
 * @date: 2018/8/7 17:30
 * @version V1.0
 * @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
 * 注意：本内容仅限于上海非码科技内部传阅，禁止外泄以及用于其他的商业目
 */
package com.freemud.sdk.api.assortment.order.enums;


import java.util.Arrays;
import java.util.List;

/**
 * 请勿使用已过期请用OldOrderAccountType 龚爱奇2019-05-19
 */
@Deprecated
public enum QueryOrderAccountType {

    DELIVERY_AMOUNT("DELIVERY_AMOUNT", "配送费"),
    BUY_DISCOUNT("BUY_DISCOUNT", "满减优惠"),
    PACK_AMOUNT("PACK_AMOUNT", "包装费"),
    COUPON("COUPON", "代金券"),
    B3S1_COUPON("B3S1_COUPON", "买3赠1券"),
    FREIGHT_COUPON("FREIGHT_COUPON", "运费券"),
    PRODUCT_COUPON("PRODUCT_COUPON", "商品券"),
    SEED_PRODUCT_COUPON("SEED_PRODUCT_COUPON", "种子券"),
    EVM_PRODUCT_COUPON("EVM_PRODUCT_COUPON", "种子券"),
    DISCOUNT_COUPON("DISCOUNT_COUPON", "折扣券"),
    DISCOUNT_AMOUNT("DISCOUNT_AMOUNT", "限时折扣金额"),
    PREMIUM_EXCHANGE("PREMIUM_EXCHANGE", "加价购"),
    SUPER_PURCHASE("SUPER_PURCHASE", "超值加购"),
    SECOND_DISCOUNT("SECOND_DISCOUNT", "第二件N折"),
    BUYM_SENDN("BUYM_SENDN", "买M赠N"),
    CUSTOMER_SCORE("CUSTOMER_SCORE", "积分兑换"),
    CARD_ORIGINAL_AMOUNT("CARD_ORIGINAL_AMOUNT", "会员卡原价"),
    SET_MEAL("SET_MEAL", "套餐商品优惠"),
    CARD_DISCOUNT_AMOUNT("CARD_DISCOUNT_AMOUNT", "会员卡优惠金额"),
    XY_DISCOUNT("XY_DISCOUNT", "x件y折"),
    TOTAL_DISCOUNT("TOTAL_DISCOUNT", "优惠总金额"),
    MONTH_CARD_TOTAL_DISCOUNT("MONTH_CARD_TOTAL_DISCOUNT", "月享卡优惠总金额"),
    ONLINE_PAY("ONLINE_PAY", "线上支付"),
    FULL_DISTRIBUTION_FEE("FULL_DISTRIBUTION_FEE", "满减配送费"),
    OFFLINE_PAY("OFFLINE_PAY", "线下支付"),
    GATHER_SPOT("GATHER_SPOT", "集点活动"),
    MEMBER_PRICE_DISCOUNT("MEMBER_PRICE_DISCOUNT", "会员价优惠"),
    MCCAFE_MONTH_CARD("MCCAFE_MONTH_CARD", "麦咖啡月卡"),
    WITH_ORDER_BUY_COUPON_FEE("WITH_ORDER_BUY_COUPON_FEE", "随单买月卡"),
    COCO_PRODUCT_CASH_COUPON("COCO_PRODUCT_CASH_COUPON", "coco商品代金券"),
    FULL_BUYM_SENDN("FULL_BUYM_SENDN", "满赠"),
    FULL_M_COUNT_N_FOLD("FULL_M_COUNT_N_FOLD", "满M件N折"),
    SCORE_PRODUCT_ACTIVITY("SCORE_PRODUCT_ACTIVITY", "积分商品活动"),
    SINGLE_PRODUCT_REDUCTION("SINGLE_PRODUCT_REDUCTION", "单品立减");
    private String code;

    private String desc;

    public static List<QueryOrderAccountType> useCouponList = Arrays.asList(COUPON, B3S1_COUPON, FREIGHT_COUPON, PRODUCT_COUPON, DISCOUNT_COUPON);

    QueryOrderAccountType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static QueryOrderAccountType getByCode(String code) {
        if (code == null) {
            return null;
        }
        for (QueryOrderAccountType type : QueryOrderAccountType.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
