package digital.laboratory.platform.imr.enums;

import lombok.Getter;

@Getter
public enum DrugUsageStatus {

    IN_USAGE(1, "领用中"),
    FINISH_USAGE(5, "已归还"),
    ;

    private final Integer status;

    private final String desc;

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

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