package com.engine.salary.report.enums;

import com.engine.salary.enums.BaseEnum;

import java.util.Objects;

/**
 * 人员类型
 */
public enum EmployeeTypeEnum implements BaseEnum<Integer> {

    ORGANIZATION(0, "组织架构", 109125),
    EXT_EMPLOYEE(1, "非系统人员", 119127),
    NOT_MATCH(2, "无匹配人员类型", 0),
    ;

    private final int value;

    private final String defaultLabel;

    private final int labelId;

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

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

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

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

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