package digital.laboratory.platform.inspetion.api.enums;

import lombok.Getter;

@Getter
public enum BusinessType {
    NPS_CASE("10001", "缴获物检验"),
    BOINT_CASE("10002", "生物样本案件"),


    BOINT_JOB("20001", "毛发任务"),
    SEWAGE_JOB("20002", "污水任务"),
    SCREENING_EVENT("30001", "筛查事件");

    BusinessType(String businessType, String businessTypeName) {
        this.businessType = businessType;
        this.businessTypeName = businessTypeName;
    }
    private final String businessType;
    private final String businessTypeName;

    public static String getBusinessTypeName(String businessType) {
        for (BusinessType type : values()) {
            if (businessType.equals(type.businessType)) {
                return type.businessTypeName;
            }
        }
        throw new RuntimeException(String.format("没有获取到%s相关的Name", businessType));
    }
    public static BusinessType getBusinessTypeByType(String businessType) {
        for (BusinessType type : values()) {
            if (businessType.equals(type.businessType)) {
                return type;
            }
        }
        throw new RuntimeException(String.format("没有获取到%s相关的Name", businessType));
    }
}
