"""Market app service registration."""
from __future__ import annotations


def register_domain_services() -> None:
    """Register services for the market app.

    Market owns: Product, CartItem, MarketPlace, NavTop, NavSub,
    Listing, ProductImage.
    Cross-app calls go over HTTP via call_action() / fetch_data().
    """
    from shared.services.registry import services
    from shared.services.market_impl import SqlMarketService

    services.market = SqlMarketService()

    from shared.services.market_data_impl import SqlMarketDataService
    services.register("market_data", SqlMarketDataService())

    # Federation needed for AP shared infrastructure (activitypub blueprint)
    if not services.has("federation"):
        from shared.services.federation_impl import SqlFederationService
        services.federation = SqlFederationService()
