package com.fs.doctor.enums;

import lombok.Getter;

@Getter
public enum WithdrawAuditStatusEnum {

    WAIT_AUDIT(0, "待审核"),
    PASS(1, "审核通过"),
    REJECT(2, "审核驳回");

    private final Integer code;
    private final String desc;

    WithdrawAuditStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static WithdrawAuditStatusEnum of(Integer code) {
        if (code == null) {
            return null;
        }
        for (WithdrawAuditStatusEnum e : values()) {
            if (e.code.equals(code)) {
                return e;
            }
        }
        throw new IllegalArgumentException("未知审核状态 code=" + code);
    }

    public boolean isWaitAudit() {
        return this == WAIT_AUDIT;
    }

    public boolean isPass() {
        return this == PASS;
    }

    public boolean isReject() {
        return this == REJECT;
    }
}
