package com.crunii.micro.common.enums;

/**
 * @author lmlksy
 * @date 2023/11/22 15:26
 */
public enum PolicyTypeEnums {

    INDUSTRIAL_SUPPORT(1, "产业扶持政策"),
    SITE_INCUBATION(2, "场地孵化政策"),
    ACHIEVEMENT_TRANSFORMATION(3, "成果转化政策"),
    INNOVATION_ENTREPRENEURSHIP(4, "创新创业政策"),
    GRADUATE_ATTRACTION(5, "高校毕业生招引政策"),
    SKILL_TRAINING(6, "技能培训政策"),
    FINANCIAL_LOAN(7, "金融贷款政策"),
    RESEARCH_FUND(8, "科研经费政策"),
    TALENT_STATION(9, "人才驿站政策"),
    TALENT_INTRODUCTION(10, "人才引进政策"),
    TAX_PREFERENCE(11, "税收优惠政策"),
    INTELLECTUAL_PROPERTY(12, "知识产权政策"),
    HOUSING_GUARANTEE(13, "住房保障政策");

    private final Integer code;
    private final String description;

    PolicyTypeEnums(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public Integer getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static Integer getCodeByDescription(String description) {
        for (PolicyTypeEnums type : values()) {
            if (type.getDescription().equals(description)) {
                return type.getCode();
            }
        }
        return null;
    }

    public static String getDescriptionByCode(Integer code) {
        for (PolicyTypeEnums type : values()) {
            if (type.getCode().equals(code)) {
                return type.getDescription();
            }
        }
        return null;
    }
}
