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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 预约提现范围：平台服务商自身或特约商户。
 *
 * @author jeesharp
 * @since 2026-06-12
 */
@Getter
@AllArgsConstructor
public enum PayFundWithdrawScopeEnum {

    /** 平台服务商 */
    PLATFORM("PLATFORM", "平台服务商"),

    /** 特约商户 */
    MERCHANT("MERCHANT", "特约商户");

    private final String value;

    private final String desc;

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

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