Replace HTTP API and MarketPlace imports with service calls
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 42s

Calendar entries route now uses services.cart.cart_summary() instead of
internal HTTP API call to cart app. Market CRUD delegates to
services.market.create_marketplace() / soft_delete_marketplace().
Updates shared submodule.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-19 05:44:18 +00:00
parent a03fa90463
commit 2527c854cb
3 changed files with 16 additions and 47 deletions

View File

@@ -219,10 +219,14 @@ def register():
select(sa_func.count()).select_from(CalendarEntry).where(*cal_filters)
) or 0
# Get product cart count from API (committed data only, which is fine)
from shared.infrastructure.internal_api import get as api_get
cart_data = await api_get("cart", "/internal/cart/summary", forward_session=True)
product_count = cart_data.get("count", 0) if cart_data else 0
# Get product cart count via service (same DB, no HTTP needed)
from shared.infrastructure.cart_identity import current_cart_identity
from shared.services.registry import services
ident = current_cart_identity()
cart_summary = await services.cart.cart_summary(
g.s, user_id=ident["user_id"], session_id=ident["session_id"],
)
product_count = cart_summary.count
total_count = product_count + cal_count
html = await render_template("_types/day/_main_panel.html")