package com.hzs.common.core.enums;

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

/**
 * Description: 修改免考状态枚举
 * Author: zhangjing
 * Time: 2022/9/1 9:06
 * Classname: WalletState
 * PackageName: com.hzs.common.core.enums
 */
@AllArgsConstructor
@Getter
public enum EFreeAssessmentState {

    /**
     * 1=复购免考
     */
    REPURCHASE(1, "复购免考", 0, EnumsPrefixConstants.EFREE_ASSESSMENT_STATE + "1"),
    /**
     * 2=分红免考
     */
    BONUS(2, "分红免考", 0, EnumsPrefixConstants.EFREE_ASSESSMENT_STATE + "2"),
    /**
     * 3=取消复购免考
     */
    CANCEL_REPURCHASE(3, "取消复购免考", 0, EnumsPrefixConstants.EFREE_ASSESSMENT_STATE + "3"),
    /**
     * 4=取消分红免考
     */
    CANCEL_BONUS(4, "取消分红免考", 0, EnumsPrefixConstants.EFREE_ASSESSMENT_STATE + "4"),




    ;

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


    /**
     * 根据枚举值获取枚举
     *
     * @param value 枚举值
     * @return
     */
    public static EFreeAssessmentState getEnumByValue(int value) {
        for (EFreeAssessmentState eApproveStatus : EFreeAssessmentState.values()) {
            if (eApproveStatus.getValue() == value) {
                return eApproveStatus;
            }
        }
        return null;
    }

}
