"""Performance / index justification for Phase 14.1 appointment tables."""
from __future__ import annotations

from app.core.database import Base
import app.models  # noqa: F401


def test_appointment_indexes_exist():
    appointments = Base.metadata.tables["appointments"]
    index_names = {idx.name for idx in appointments.indexes}
    assert "ix_appointments_tenant_status" in index_names
    assert "ix_appointments_branch" in index_names
    assert "ix_appointments_staff" in index_names


def test_outbox_indexes_exist():
    outbox = Base.metadata.tables["outbox_events"]
    index_names = {idx.name for idx in outbox.indexes}
    assert "ix_beauty_business_outbox_status" in index_names
    assert "ix_beauty_business_outbox_tenant" in index_names
