package digital.laboratory.platform.entrustment.enums;

import lombok.Getter;

@Getter
public enum EntrustIdentificationSituationType {

    FIRST_IDENT(0, "首次鉴定"),
    SUPPLY_IDENT(1, "补充鉴定"),
    AFRESF_IDENT(2, "重新鉴定"),
    PRIMARY_SCREEN(3, "初筛（不要报告、只要结果）"),
    MYANMAR_PERSON(4, "涉缅人员"),
    VOLUNTARY_PERSON(5, "自愿戒治人员")
    ;

    private final Integer code;

    private final String desc;

    EntrustIdentificationSituationType(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    // 根据名称判断是否存在对应枚举
    public static EntrustIdentificationSituationType isExist(String desc) {
        for (EntrustIdentificationSituationType entrustIdentificationSituationType : values()) {
            if (entrustIdentificationSituationType.getDesc().equals(desc)) {
                return entrustIdentificationSituationType;
            }
        }
        throw new IllegalArgumentException("No enum constant with desc: " + desc);
    }

}
