package com.jeesharp.business.modules.mall.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * SPU 审核状态枚举，与 {@code mall_spu.audit_status} 一致。
 *
 * @author jeesharp
 * @since 2026-04-28
 */
@Getter
@AllArgsConstructor
public enum MallSpuAuditStatusEnum {

    /** 待审核 */
    PENDING(0, "待审核"),

    /** 已通过 */
    PASSED(1, "已通过"),

    /** 已驳回 */
    REJECTED(2, "已驳回");

    private final Integer value;
    private final String desc;

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