"""
Admin API for NiBiS Data Management (barrel re-export)

This module was split into:
  - admin_nibis.py      (NiBiS ingestion, search, stats)
  - admin_rag.py        (RAG upload, metrics, storage)
  - admin_templates.py  (Legal templates ingestion, search)

The `router` object is assembled here by including all sub-routers.
Importers that did `from admin.api import router` continue to work.
"""

from fastapi import APIRouter

from .nibis import router as _nibis_router
from .rag import router as _rag_router
from .templates import router as _templates_router

# Re-export internal state for test importers
from .nibis import (  # noqa: F401
    _ingestion_status,
    NiBiSSearchRequest,
    search_nibis,
)
from .rag import _upload_history  # noqa: F401
from .templates import _templates_ingestion_status  # noqa: F401

# Assemble the combined router.
# All sub-routers use prefix="/api/v1/admin", so include without extra prefix.
router = APIRouter()
router.include_router(_nibis_router)
router.include_router(_rag_router)
router.include_router(_templates_router)
