package com.freemud.application.sdk.api.ordercenter.enums;

public enum CashTypeEnum {

    OTHER("10", "其他"),
    HLM("50", "汇来米"),
    SQB("51", "收钱吧"),
    CASH("52", "现金"),
    THIRD_COUPON("53", "三方券支付"),

    MEITUAN_COUPON("54", "美团团购券支付"),
    TIKTOK_COUPON("55", "抖音团购券支付"),
    ;


    private String code;
    private String desc;

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

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

    public String getDesc() {
        return desc;
    }

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

    public String getCode() {
        return code;
    }

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


    public static boolean isThirdCoupon(String payType) {
        return THIRD_COUPON.getCode().equals(payType) ||
                MEITUAN_COUPON.getCode().equals(payType) ||
                TIKTOK_COUPON.getCode().equals(payType);
    }
}
