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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 商户结算打款记录状态枚举。
 *
 * @author jeesharp
 * @since 2026-06-29
 */
@Getter
@AllArgsConstructor
public enum MerchantSettlementPayoutStatusEnum {

    SUCCESS("SUCCESS", "成功"),
    FAILED("FAILED", "失败");

    private final String value;

    private final String desc;

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

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