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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 商户注销 · 是否提取资金（微信 withdraw 字段）。
 *
 * @author jeesharp
 * @since 2026-06-15
 */
@Getter
@AllArgsConstructor
public enum PaySubMerchantCancelWithdrawEnum {

    /** 仅注销，不申请提现 */
    NOT_APPLY_WITHDRAW("NOT_APPLY_WITHDRAW", "仅注销"),

    /** 注销并申请提现余额 */
    APPLY_WITHDRAW("APPLY_WITHDRAW", "注销并提现");

    private final String value;
    private final String desc;

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

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