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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 微信资金账户类型（平台/特约商户余额查询共用）。
 *
 * @author jeesharp
 * @since 2026-06-12
 */
@Getter
@AllArgsConstructor
public enum PayFundAccountTypeEnum {

    /** 基本账户 */
    BASIC("BASIC", "基本账户"),

    /** 运营账户 */
    OPERATION("OPERATION", "运营账户"),

    /** 手续费账户 */
    FEES("FEES", "手续费账户");

    private final String value;

    private final String desc;

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

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