"""Sentinel V7 Cloud + Edge structural checks."""
from pathlib import Path
from sentinel.api.app import app, cloud_store

ROOT = Path(__file__).resolve().parents[1]
assert app.version == "7.0.1"
paths = {getattr(route, "path", "") for route in app.routes}
required = {
    "/cloud",
    "/api/v7/cloud/status",
    "/api/v7/devices",
    "/api/v7/device-events",
    "/api/v7/devices/register",
    "/api/v7/devices/heartbeat",
    "/api/v7/sync/measurements",
    "/api/v7/cloud/sweep",
}
missing = required - paths
assert not missing, f"Missing V7 routes: {sorted(missing)}"
assert (ROOT / "sentinel/cloud/store.py").exists()
assert (ROOT / "sentinel/cloud/edge_client.py").exists()
assert (ROOT / "sentinel/notifications/templates.py").exists()
assert (ROOT / "tools/v7_edge_agent.py").exists()
assert (ROOT / "templates/cloud_console.html").exists()
print("Sentinel V7 Cloud + Edge checks: OK")
