package com.engine.salary.enums.salarysend;


import com.engine.salary.enums.BaseEnum;

import java.util.Objects;

/**
 * @ClassName SalaryAutoSendCycleTypeEnum
 * @author Harryxzy
 * @date 2023/7/4 17:30
 * @description 自动发送工资单周期
 */
public enum SalaryAutoSendCycleTypeEnum implements BaseEnum<Integer> {

    THIS_MONTH(1, "本月", 86072),
    NEXT_MONTH(2, "下月", 86073);

    private int value;

    private String defaultLabel;

    private int labelId;

    SalaryAutoSendCycleTypeEnum(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 SalaryAutoSendCycleTypeEnum parseByValue(int value) {
        for (SalaryAutoSendCycleTypeEnum salaryCycleTypeEnum : SalaryAutoSendCycleTypeEnum.values()) {
            if (Objects.equals(salaryCycleTypeEnum.getValue(), value)) {
                return salaryCycleTypeEnum;
            }
        }
        return null;
    }
}
