package com.sundot.airport.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 设备台账使用状态枚举
 */
@Getter
@AllArgsConstructor
public enum EquipmentUsageStatusEnum {

    IN_USE("IN_USE", "在用"),
    SEND_FOR_REPAIR("SEND_FOR_REPAIR", "寄修"),
    LEND("LEND", "借出"),
    DEACTIVATE("DEACTIVATE", "停用"),
    NOT_ENABLED("NOT_ENABLED", "未启用"),
    SUSPEND_USE("SUSPEND_USE", "暂停使用");

    private final String code;
    private final String desc;

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

}
