package com.fs.doctor.enums;

import lombok.Getter;

@Getter
public enum WithdrawPaymentStatusEnum {

    WAIT_PAY(0, "待打款"),
    PAID(1, "打款完成");

    private final Integer code;
    private final String desc;

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

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

    public boolean isWaitPay() {
        return this == WAIT_PAY;
    }

    public boolean isPaid() {
        return this == PAID;
    }
}
