package digital.laboratory.platform.imr.enums;

import lombok.Getter;

@Getter
public enum DrugHandingOverApplyStatus {

    WAIT_HANDING_OVER(0, "待提交"),
    WAIT_ACCEPT(3, "待收样"),
    AGREE_ACCEPT(5, "确认收样"),
    REJECT_ACCEPT(-5, "拒绝收样"),
    FINISH(9, "完成收样"),
    ;

    private final Integer status;

    private final String desc;

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

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

}
