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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 分账操作日志动作枚举。
 *
 * @author jeesharp
 * @since 2026-06-11
 */
@Getter
@AllArgsConstructor
public enum ProfitSharingLogActionEnum {

    REQUEST("REQUEST", "请求分账"),
    QUERY("QUERY", "查询分账"),
    RETRY("RETRY", "重试分账"),
    FINISH("FINISH", "完结分账");

    private final String value;
    private final String desc;

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

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