package com.engine.salary.enums;


import java.util.Objects;

/**
 * @description: 薪资项目属性
 * @author: xiajun
 * @modified By: xiajun
 * @date: Created in 10/25/21 2:23 PM
 * @version:v1.0
 */
public enum SalaryItemCategoryEnum implements BaseEnum<Integer> {

    PRE_TAX_ADD(1, "税前加项", 84492),
    PRE_TAX_DUD(2, "税前减项", 84493),
    AFTER_TAX_ADD(3, "税后加项", 84494),
    AFTER_TAX_DUD(4, "税后减项", 84495),
    SUM(5, "统计项", 84497),
    TAX(6, "税费项", 84498),
    OTHER(7, "其他项", 84499);

    private int value;

    private String defaultLabel;

    private int labelId;

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