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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 分账接收方结果枚举，与微信分账明细结果对齐。
 *
 * @author jeesharp
 * @since 2026-06-11
 */
@Getter
@AllArgsConstructor
public enum ProfitSharingReceiverResultEnum {

    PENDING("PENDING", "待处理"),
    SUCCESS("SUCCESS", "成功"),
    FAIL("FAIL", "失败");

    private final String value;
    private final String desc;

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

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