from api.schemas.agent_message import MessageCreate
from api.schemas.capability_request import (
    CapabilityRequestDispute,
    CapabilityRequestStatusPatch,
    CatalogCreate,
    CatalogPatch,
    CatalogRead,
)
from api.schemas.doi import DoIReport
from api.schemas.domain import DomainCreate, DomainRead, DomainRename, DomainUpdate
from api.schemas.managed_repo import RepoCreate, RepoPathRegister, RepoRead
from api.schemas.tpsc import GDPR_WARNING_LEVELS, TPSCCatalogRead, TPSCGDPRReport
from hub_core.schemas.agent_message import MessageCreate as CoreMessageCreate
from hub_core.schemas.capability import (
    CapabilityRequestDispute as CoreCapabilityRequestDispute,
    CapabilityRequestStatusPatch as CoreCapabilityRequestStatusPatch,
    CatalogCreate as CoreCatalogCreate,
    CatalogPatch as CoreCatalogPatch,
    CatalogRead as CoreCatalogRead,
)
from hub_core.schemas.doi import DoIReport as CoreDoIReport
from hub_core.schemas.domain import (
    DomainCreate as CoreDomainCreate,
    DomainRead as CoreDomainRead,
    DomainRename as CoreDomainRename,
    DomainUpdate as CoreDomainUpdate,
)
from hub_core.schemas.managed_repo import (
    RepoCreate as CoreRepoCreate,
    RepoPathRegister as CoreRepoPathRegister,
    RepoRead as CoreRepoRead,
)
from hub_core.schemas.tpsc import (
    GDPR_WARNING_LEVELS as CORE_GDPR_WARNING_LEVELS,
    TPSCCatalogRead as CoreTPSCCatalogRead,
    TPSCGDPRReport as CoreTPSCGDPRReport,
)


def test_state_hub_reexports_core_message_schema() -> None:
    assert MessageCreate is CoreMessageCreate


def test_state_hub_reexports_core_doi_schema() -> None:
    assert DoIReport is CoreDoIReport


def test_state_hub_reexports_core_domain_base_schemas() -> None:
    assert DomainCreate is CoreDomainCreate
    assert DomainRead is CoreDomainRead
    assert DomainRename is CoreDomainRename
    assert DomainUpdate is CoreDomainUpdate


def test_state_hub_reexports_core_capability_base_schemas() -> None:
    assert CatalogCreate is CoreCatalogCreate
    assert CatalogPatch is CoreCatalogPatch
    assert CatalogRead is CoreCatalogRead
    assert CapabilityRequestDispute is CoreCapabilityRequestDispute
    assert CapabilityRequestStatusPatch is CoreCapabilityRequestStatusPatch


def test_state_hub_reexports_core_repo_path_schema() -> None:
    assert RepoPathRegister is CoreRepoPathRegister


def test_state_hub_repo_schemas_extend_core_contracts() -> None:
    assert issubclass(RepoCreate, CoreRepoCreate)
    assert issubclass(RepoRead, CoreRepoRead)
    assert "topic_id" in RepoCreate.model_fields
    assert "last_state_synced_at" in RepoRead.model_fields


def test_state_hub_reexports_core_tpsc_schemas() -> None:
    assert TPSCCatalogRead is CoreTPSCCatalogRead
    assert TPSCGDPRReport is CoreTPSCGDPRReport
    assert GDPR_WARNING_LEVELS is CORE_GDPR_WARNING_LEVELS
