from pathlib import Path

ROOT = Path(__file__).resolve().parents[1]


def test_migrations_exist():
    assert (ROOT / "migrations" / "001_core_indexes.sql").exists()
    assert (ROOT / "scripts" / "apply_migrations.py").exists()


def test_admin_ui_router_exists():
    assert (ROOT / "app" / "admin_ui" / "router.py").exists()
    main = (ROOT / "app" / "main.py").read_text()
    assert "app.admin_ui.router" in main


def test_internal_api_exists():
    assert (ROOT / "app" / "api" / "internal.py").exists()
    main = (ROOT / "app" / "main.py").read_text()
    assert "internal_api_router" in main
