package com.engine.salary.enums;


import java.util.Objects;

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

    SALARY(1, SalaryItemCategoryEnum.PRE_TAX_ADD, "工资薪金", 85818),
    BONUS(2, SalaryItemCategoryEnum.PRE_TAX_ADD, "全年一次性奖金", 85820),
    INTEREST_DIVIDEND(3, SalaryItemCategoryEnum.PRE_TAX_ADD, "利息股息红利", 85821),
    LABOR_REMUNERATION(4, SalaryItemCategoryEnum.PRE_TAX_ADD, "劳务报酬", 85822),
    REMUNERATION(5, SalaryItemCategoryEnum.PRE_TAX_ADD, "稿酬", 85823),
    ROYALTIES(6, SalaryItemCategoryEnum.PRE_TAX_ADD, "特许权使用费", 85824),
    ACCIDENTAL_INCOME(7, SalaryItemCategoryEnum.PRE_TAX_ADD, "偶然所得", 85825),
    SEVERANCE_COMPENSATION(8, SalaryItemCategoryEnum.PRE_TAX_ADD, "离职补偿金", 85826),
    PRE_TAX_DEDUCTION(9, SalaryItemCategoryEnum.PRE_TAX_DUD, "税前扣款", 85828),
    SPECIAL_DEDUCTION(10, SalaryItemCategoryEnum.PRE_TAX_DUD, "专项扣除", 85829),
    SPECIAL_ADDITIONAL_DEDUCTION(11, SalaryItemCategoryEnum.PRE_TAX_DUD, "专项附加扣除", 85830),
    OTHER_DEDUCTIONS(12, SalaryItemCategoryEnum.PRE_TAX_DUD, "其他扣除", 85831),
    AFTER_TAX_REIMBURSEMENT(13, SalaryItemCategoryEnum.AFTER_TAX_ADD, "税后报销", 85832),
    AFTER_TAX_ADJUSTMENT(14, SalaryItemCategoryEnum.AFTER_TAX_ADD, "税后调整", 85833),
    AFTER_TAX_DEDUCTION(15, SalaryItemCategoryEnum.AFTER_TAX_DUD, "税后扣款", 85834),
    TAX(16, SalaryItemCategoryEnum.TAX, "税费", 85835),
    EMPLOYEE_INFO(18, SalaryItemCategoryEnum.OTHER, "员工基本信息", 85366),
    ATTEND_INFO(20, SalaryItemCategoryEnum.OTHER, "员工考勤信息", 98890),
    OTHER(19, SalaryItemCategoryEnum.OTHER, "其他数值", 100114),
    TEXT(17, SalaryItemCategoryEnum.OTHER, "其他文本", 100115),
    OTHER_LOGIC(21, SalaryItemCategoryEnum.OTHER, "其他逻辑", 100116),
    STATISTICAL_ITEM(22, SalaryItemCategoryEnum.SUM, "统计项", 84497),
    ;

    private int value;

    private SalaryItemCategoryEnum category;

    private String defaultLabel;

    private int labelId;

    SalaryItemTypeEnum(int value, SalaryItemCategoryEnum category, String defaultLabel, int labelId) {
        this.value = value;
        this.category = category;
        this.defaultLabel = defaultLabel;
        this.labelId = labelId;
    }

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

    public SalaryItemCategoryEnum getCategory() {
        return category;
    }

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

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

    public static SalaryItemTypeEnum parseByValue(int value) {
        for (SalaryItemTypeEnum salaryItemTypeEnum : SalaryItemTypeEnum.values()) {
            if (Objects.equals(salaryItemTypeEnum.getValue(), value)) {
                return salaryItemTypeEnum;
            }
        }
        return null;
    }
}
