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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 商户结算单状态枚举。
 *
 * @author jeesharp
 * @since 2026-06-29
 */
@Getter
@AllArgsConstructor
public enum MerchantSettlementBillStatusEnum {

    PENDING_PAYOUT("PENDING_PAYOUT", "待打款"),
    PAID("PAID", "已打款"),
    MERCHANT_CONFIRMED("MERCHANT_CONFIRMED", "商户已确认"),
    CANCELLED("CANCELLED", "已作废");

    private final String value;

    private final String desc;

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

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