"""Aggregate router for the modular ClientFlow admin UI.

As of v4.7.2, route registration is split by domain under
``app.admin_ui.pages``. Handler internals are intentionally reused from the
legacy module where needed so URLs and behavior remain stable.
"""
from fastapi import APIRouter, Depends

from app.admin_dashboard import require_admin_access, router as legacy_router
from app.admin_ui.pages import dashboard
from app.admin_ui.pages import operations
from app.admin_ui.pages import opportunities
from app.admin_ui.pages import tasks
from app.admin_ui.pages import customers
from app.admin_ui.pages import products
from app.admin_ui.pages import orders
from app.admin_ui.pages import finance
from app.admin_ui.pages import revenue_forecast
from app.admin_ui.pages import integrations
from app.admin_ui.pages import communications
from app.admin_ui.pages import outbox
from app.admin_ui.pages import events
from app.admin_ui.pages import runs
from app.admin_ui.pages import queues
from app.admin_ui.pages import conversations
from app.admin_ui.pages import system
from app.admin_ui.pages import reconciliation


router = APIRouter(prefix="", tags=["admin"], dependencies=[Depends(require_admin_access)])

# Keep the legacy CSS endpoint available while page routes live in domain modules.
router.include_router(legacy_router)

router.include_router(dashboard.router)
router.include_router(operations.router)
router.include_router(reconciliation.router)
router.include_router(opportunities.router)
router.include_router(tasks.router)
router.include_router(customers.router)
router.include_router(products.router)
router.include_router(orders.router)
router.include_router(finance.router)
router.include_router(revenue_forecast.router)
router.include_router(integrations.router)
router.include_router(communications.router)
router.include_router(outbox.router)
router.include_router(events.router)
router.include_router(runs.router)
router.include_router(queues.router)
router.include_router(conversations.router)
router.include_router(system.router)

__all__ = ["router"]
