"""Admin Guide — read the single tracked standalone HTML file, rewritten for in-app serving.""" from __future__ import annotations from fastapi import APIRouter from sinetti_api.schemas import AdminGuideResponse from sinetti_services import admin_guide_service router = APIRouter(prefix="/api/admin/guide", tags=["admin_guide_admin"]) @router.get("", response_model=AdminGuideResponse) def get_admin_guide() -> AdminGuideResponse: guide = admin_guide_service.read_guide() if not guide.html: return AdminGuideResponse( ok=False, html="", path=guide.path, updated_at=guide.updated_at, message="Admin guide is unavailable on this build.", ) return AdminGuideResponse( ok=True, html=guide.html, path=guide.path, updated_at=guide.updated_at, message="" )