package digital.laboratory.platform.imr.enums;

import lombok.Getter;

@Getter
public enum DrugMaterialStatus {

    ENTER_DRUG_INFO(0, "录入信息中"),
    WAIT_INBOUND(3, "待入库"),
    FINISH_INBOUND(5, "已入库"),
    OUTBOUND(7, "已出库")
    ;

    private final Integer status;

    private final String desc;

    DrugMaterialStatus(Integer status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public static DrugMaterialStatus fromStatus(Integer status) {
        for (DrugMaterialStatus drugMaterialStatus : values()) {
            if (drugMaterialStatus.getStatus().equals(status)) {
                return drugMaterialStatus;
            }
        }
        throw new IllegalArgumentException("No enum constant with code: " + status);
    }
}
