package com.engine.salary.enums.salarysob;

import com.engine.salary.enums.BaseEnum;

import java.util.Objects;

/**
 * 调薪规则
 * <p>Copyright: Copyright (c) 2022</p>
 * <p>Company: 泛微软件</p>
 *
 * @author qiantao
 * @version 1.0
 **/
public enum SalarySobAdjustRuleTypeEnum implements BaseEnum<Integer> {

    USE_BEFORE_ADJUSTMENT(1,"取调薪前薪资", 100121),
    USE_AFTER_ADJUSTMENT(2, "取调薪后薪资",100131),
    AVERAGE(3, "平均值", 100132),
    PARTITION(4, "分段计薪",97005),
    ;

    SalarySobAdjustRuleTypeEnum(int value, String defaultLabel, int labelId) {
        this.value = value;
        this.defaultLabel = defaultLabel;
        this.labelId = labelId;
    }

    private int value;

    private String defaultLabel;

    private int labelId;

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public Integer getLabelId() {
        return labelId;
    }

    @Override
    public String getDefaultLabel() {
        return defaultLabel;
    }

    public static SalarySobAdjustRuleTypeEnum parseByValue(Integer value){
        for (SalarySobAdjustRuleTypeEnum salarySobAdjustRuleTypeEnum : SalarySobAdjustRuleTypeEnum.values()) {
            if(Objects.equals(salarySobAdjustRuleTypeEnum.getValue(), value)){
                return salarySobAdjustRuleTypeEnum;
            }
        }
        return null;
    }
}
