package com.jeesharp.business.modules.pay.payfundwithdraw.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 微信预约提现单状态。
 *
 * @author jeesharp
 * @since 2026-06-12
 */
@Getter
@AllArgsConstructor
public enum PayFundWithdrawStatusEnum {

    /** 业务单已创建 */
    INIT("INIT", "业务单已创建"),

    /** 受理成功 */
    CREATE_SUCCESS("CREATE_SUCCESS", "受理成功"),

    /** 提现成功 */
    SUCCESS("SUCCESS", "提现成功"),

    /** 提现失败 */
    FAIL("FAIL", "提现失败"),

    /** 提现退票 */
    REFUND("REFUND", "提现退票"),

    /** 关单 */
    CLOSE("CLOSE", "关单");

    private final String value;

    private final String desc;

    public static PayFundWithdrawStatusEnum fromValue(String value) {
        if (value == null) {
            return null;
        }
        for (PayFundWithdrawStatusEnum e : values()) {
            if (e.getValue().equals(value)) {
                return e;
            }
        }
        return null;
    }

    public static String getDescByValue(String value) {
        PayFundWithdrawStatusEnum e = fromValue(value);
        return e != null ? e.getDesc() : "";
    }
}
