from zbt.infrastructure.mysql.agent_models import AgentBase
from zbt.infrastructure.mysql.analytics_models import AnalyticsBase
from zbt.infrastructure.mysql.core_models import CoreBase


def test_each_mysql_database_has_its_own_foundation_metadata() -> None:
    assert {
        "h5_users",
        "admin_users",
        "roles",
        "permissions",
        "auth_sessions",
        "products",
        "product_versions",
        "plans",
        "eligibility_rules",
        "rate_tables",
        "salespersons",
        "promotion_codes",
        "lead_attributions",
        "order_attributions",
        "knowledge_documents",
        "knowledge_search_tests",
        "material_recognitions",
        "service_requests",
    } <= set(CoreBase.metadata.tables)
    assert {
        "agent_threads",
        "agent_messages",
        "agent_runs",
        "customer_memories",
    } <= set(AgentBase.metadata.tables)
    assert {
        "dim_date",
        "dim_product",
        "dim_salesperson",
        "fact_orders",
        "fact_policies",
        "metric_definitions",
        "analytics_sync_offsets",
    } <= set(AnalyticsBase.metadata.tables)
