"""Documentation validation for Beauty Business Phase 14.7."""
from pathlib import Path

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


def test_phase_docs_exist():
    assert (ROOT / "docs" / "beauty-business-roadmap.md").exists()
    assert (ROOT / "docs" / "phases" / "BeautyBusiness" / "phase-14-0-beauty-foundation.md").exists()
    assert (ROOT / "docs" / "phases" / "BeautyBusiness" / "phase-14-7-marketing-loyalty.md").exists()
    assert (ROOT / "docs" / "phases" / "BeautyBusiness" / "README.md").exists()


def test_module_registry_mentions_beauty_business():
    text = (ROOT / "docs" / "module-registry.md").read_text(encoding="utf-8")
    assert "beauty_business" in text.lower()
    assert "beauty_business_db" in text
    assert "beauty_business." in text


def test_progress_mentions_beauty_business():
    text = (ROOT / "docs" / "progress.md").read_text(encoding="utf-8")
    assert "14." in text or "Beauty" in text


def test_service_readme_documents_boundaries():
    text = (ROOT / "backend" / "services" / "beauty_business" / "README.md").read_text(
        encoding="utf-8"
    )
    assert "beauty_business_db" in text
    assert "8011" in text
    assert "appointments" in text.lower() or "booking" in text.lower()
