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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 修改结算账户 · 账户类型（微信 modify-settlement 接口）。
 *
 * @author jeesharp
 * @since 2026-06-12
 */
@Getter
@AllArgsConstructor
public enum PaySubMerchantSettlementAccountTypeEnum {

    /** 对公银行账户 */
    BUSINESS("ACCOUNT_TYPE_BUSINESS", "对公银行账户"),

    /** 经营者个人银行卡 */
    PRIVATE("ACCOUNT_TYPE_PRIVATE", "经营者个人银行卡");

    private final String value;
    private final String desc;

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

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