package org.qinan.safetyeval.domain.constant;

/**
 * 材料类型
 */
public enum MaterialTypeEnum {

    MATERIAL_CATALOG(1, "申请材料目录（原件）"),
    APPLICATION_FORM(2, "申请书（原件）"),
    LEGAL_PERSON_CERT(3, "法人证明（复印件）"),
    NO_VIOLATION_RECORD(4, "三年内无重大违法失信记录查询证明"),
    LEGAL_REP_COMMITMENT(5, "法定代表人承诺书（原件）"),
    FIXED_ASSETS_CERT(6, "固定资产法定证明材料"),
    WORKPLACE_AREA_CERT(7, "工作场所及档案室面积证明"),
    PROFESSIONAL_ABILITY_CERT(8, "安全评价师专业能力证明"),
    RELATED_PERSONNEL_CERT(9, "相关负责人证明材料"),
    INTERNAL_MANAGEMENT_SYSTEM(10, "机构内部管理制度"),
    ;

    public static final String REMARKS = "1,申请材料目录（原件）,2,申请书（原件）,3,法人证明（复印件）,4,三年内无重大违法失信记录查询证明,5,法定代表人承诺书（原件）,6,固定资产法定证明材料,7,工作场所及档案室面积证明,8,安全评价师专业能力证明,9,相关负责人证明材料,10,机构内部管理制度";

    private final int code;
    private final String name;

    MaterialTypeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static MaterialTypeEnum ofCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (MaterialTypeEnum item : values()) {
            if (item.code == code) {
                return item;
            }
        }
        return null;
    }
}
