package com.sundot.airport.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 附件来源类型枚举
 */
@Getter
@AllArgsConstructor
public enum BaseAttachmentSourceTypeEnum {

    CHECK_RECORD("CHECK_RECORD", "检查记录表"),
    CHECK_CORRECTION("CHECK_CORRECTION", "问题整改表"),
    CHECK_CORRECTION_RECORD("CHECK_CORRECTION_RECORD", "问题整改表中检查记录"),
    CHECK_PROJECT_ITEM("CHECK_PROJECT_ITEM", "检查项明细表"),
    ITEM_SEIZURE_ITEMS("ITEM_SEIZURE_ITEMS", "查获物品明细表");

    private final String code;
    private final String info;

    public static BaseAttachmentSourceTypeEnum getByCode(String code) {
        for (BaseAttachmentSourceTypeEnum itemEnum : values()) {
            if (itemEnum.getCode().equals(code)) {
                return itemEnum;
            }
        }
        return null;
    }
}
