package com.engine.salary.enums.salarysob;

import com.engine.salary.enums.BaseEnum;

import java.util.Objects;

/**
 * 应税项目
 * <p>Copyright: Copyright (c) 2022</p>
 * <p>Company: 泛微软件</p>
 *
 * @author qiantao
 * @version 1.0
 **/
public enum IncomeCategoryEnum implements BaseEnum<Integer> {

    WAGES_AND_SALARIES(1, "正常工资薪金所得", 98656),

    REMUNERATION_FOR_LABOR(4, "劳务报酬所得", 105218),

    // 暂时注释掉，后续会开放
    ONETIME_ANNUAL_BONUS(2,"全年一次性奖金收入", 0)
//
//    OTHER(11, "其他所得", 0),
    ;

    private int value;

    private String defaultLabel;

    private int labelId;

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