package com.engine.salary.enums.salarysend;

import com.engine.salary.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@AllArgsConstructor
@Getter
public enum SalarySendRangeTargetTypeEnum implements BaseEnum<Integer> {
    USER(1, "人员", 100133),
    DEPT(2, "部门", 86185),
    SUB_COMPANY(3, "分部", 107369),
    POSITION(4, "岗位", 90633),
//    TAX_AGENT(5, "个税扣缴义务人", 86184),
    ALL(0, "所有人", 107729);

    private final int value;

    private final String defaultLabel;

    private final int labelId;

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

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

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

    public static SalarySendRangeTargetTypeEnum fromValue(Integer value) {
        for (SalarySendRangeTargetTypeEnum targetTypeEnum : SalarySendRangeTargetTypeEnum.values()) {
            if (Objects.equals(targetTypeEnum.getValue(), value)) {
                return targetTypeEnum;
            }
        }
        return null;
    }
}