package com.hzs.common.core.enums;

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

/**
 * @Description: 预售状态
 * @Author: jiang chao
 * @Time: 2022/11/4 14:05
 * @Classname: EPresaleStatus
 * @PackageName: com.hzs.common.core.enums
 */
@AllArgsConstructor
@Getter
public enum EPresaleStatus {

    /**
     * 在售
     */
    ON_SALE(0, "在售", 0, EnumsPrefixConstants.PRESALE_STATUS + "0"),

    /**
     * 预售
     */
    PRESALE(1, "预售", 0, EnumsPrefixConstants.PRESALE_STATUS + "1"),

    /**
     * 已售罄  2.0删除该项 已对接过设计
     */
//    SOLD_OUT(2, "已售罄", 0, EnumsPrefixConstants.PRESALE_STATUS + "2"),

    /**
     * 缺货
     */
    OUT_STOCK(3, "缺货", 0, EnumsPrefixConstants.PRESALE_STATUS + "3"),

    ;

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

    public static EPresaleStatus getEPresaleStatus(int value ){
        for (EPresaleStatus ePresaleStatus : EPresaleStatus.values()) {
            if (ePresaleStatus.getValue() == value){
                return ePresaleStatus;
            }
        }
        return null;
    }

}
