package com.engine.salary.enums;


import java.util.Objects;

/**
 * 薪资周期
 * <p>Copyright: Copyright (c) 2022</p>
 * <p>Company: 泛微软件</p>
 *
 * @author qiantao
 * @version 1.0
 **/
public enum SalaryCycleTypeEnum implements BaseEnum<Integer> {

    BEFORE_LAST_MONTH(1, "上上月", 86075),
    LAST_MONTH(2, "上月", 86074),
    THIS_MONTH(3, "本月", 86072),
    NEXT_MONTH(4, "下月", 86073);

    private int value;

    private String defaultLabel;

    private int labelId;

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

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

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

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

    public static SalaryCycleTypeEnum parseByValue(int value) {
        for (SalaryCycleTypeEnum salaryCycleTypeEnum : SalaryCycleTypeEnum.values()) {
            if (Objects.equals(salaryCycleTypeEnum.getValue(), value)) {
                return salaryCycleTypeEnum;
            }
        }
        return null;
    }
}
