package com.hzs.common.core.enums;

import com.hzs.common.core.constant.EnumsPrefixConstants;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 会员类型
 */
@AllArgsConstructor
@Getter
public enum ECustomerType {

    /**
     * 正常
     */
    NORMAL(0, "正常", 0, EnumsPrefixConstants.CUSTOMER_TYPE + "0"),

    /**
     * 空单
     */
    EMPTY_ORDER(1, "空单", 0, EnumsPrefixConstants.CUSTOMER_TYPE + "1"),

    /**
     * 死点
     */
    DEAD_POINT(2, "死点", 0, EnumsPrefixConstants.CUSTOMER_TYPE + "2"),

    /**
     * 会员
     */
    HAI_FANS(6, "会员", 0, EnumsPrefixConstants.CUSTOMER_TYPE + "6"),
    ;

    /**
     * 实际值
     */
    private final int value;
    /**
     * 显示标签
     */
    private final String label;
    /**
     * 是否启用（0=是,1=否） -- 来源EYesNo
     */
    private final int enable;
    /**
     * 国际化翻译key值
     */
    private final String key;

    public static ECustomerType getCustomerType(int value) {
        for (ECustomerType customerType : ECustomerType.values()) {
            if (customerType.getValue() == value) {
                return customerType;
            }
        }
        return null;
    }
}
