diff --git a/bp/cart/services/checkout.py b/bp/cart/services/checkout.py index 85c7cc1..ef2843b 100644 --- a/bp/cart/services/checkout.py +++ b/bp/cart/services/checkout.py @@ -9,10 +9,10 @@ from sqlalchemy.orm import selectinload from shared.models.market import Product, CartItem from shared.models.order import Order, OrderItem -from shared.models.calendars import Calendar from shared.models.page_config import PageConfig from shared.models.market_place import MarketPlace from shared.config import config +from shared.contracts.dtos import CalendarEntryDTO from shared.events import emit_event from shared.services.registry import services @@ -64,7 +64,7 @@ async def find_or_create_cart_item( async def resolve_page_config( session: AsyncSession, cart: list[CartItem], - calendar_entries: list[CalendarEntry], + calendar_entries: list[CalendarEntryDTO], ) -> Optional["PageConfig"]: """Determine the PageConfig for this order. @@ -82,9 +82,8 @@ async def resolve_page_config( # From calendar entries via calendar for entry in calendar_entries: - cal = await session.get(Calendar, entry.calendar_id) - if cal and cal.container_id: - post_ids.add(cal.container_id) + if entry.calendar_container_id: + post_ids.add(entry.calendar_container_id) if len(post_ids) > 1: raise ValueError("Cannot checkout items from multiple pages") @@ -105,7 +104,7 @@ async def resolve_page_config( async def create_order_from_cart( session: AsyncSession, cart: list[CartItem], - calendar_entries: list[CalendarEntry], + calendar_entries: list[CalendarEntryDTO], user_id: Optional[int], session_id: Optional[str], product_total: float, diff --git a/shared b/shared index 9cba422..b3a0e99 160000 --- a/shared +++ b/shared @@ -1 +1 @@ -Subproject commit 9cba422aa9c072db4bbb2662315d66ea011bd19e +Subproject commit b3a0e9922ac403caf54805b13fff652503b5d07d