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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 商户结算配置启用状态枚举。
 *
 * @author jeesharp
 * @since 2026-06-11
 */
@Getter
@AllArgsConstructor
public enum MerchantSettleConfigStatusEnum {

    DISABLED(0, "禁用"),
    ENABLED(1, "启用");

    private final Integer value;
    private final String desc;

    public static MerchantSettleConfigStatusEnum fromValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (MerchantSettleConfigStatusEnum e : values()) {
            if (e.value.equals(value)) {
                return e;
            }
        }
        return null;
    }

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