package com.jeesharp.business.modules.finance.merchantsettlement.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 商户结算打款方式枚举。
 *
 * @author jeesharp
 * @since 2026-06-29
 */
@Getter
@AllArgsConstructor
public enum MerchantSettlementPayoutMethodEnum {

    BANK_TRANSFER("BANK_TRANSFER", "银行转账"),
    WECHAT_OFFLINE("WECHAT_OFFLINE", "微信线下"),
    OTHER("OTHER", "其他");

    private final String value;

    private final String desc;

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

    public static String getDescByValue(String value) {
        if (value == null) {
            return "";
        }
        for (MerchantSettlementPayoutMethodEnum item : values()) {
            if (item.getValue().equals(value)) {
                return item.getDesc();
            }
        }
        return value;
    }
}
