Update shared submodule + emit product events for federation
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 52s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 52s
- Emit product.listed events when products are created - Updated shared with federation handlers, delivery, anchoring Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -291,6 +291,20 @@ async def _create_product_from_payload(session: AsyncSession, payload: Dict[str,
|
||||
#await session.flush() # get p.id
|
||||
_replace_children(p, payload)
|
||||
await session.flush()
|
||||
|
||||
# Emit federation event for new products
|
||||
from shared.events import emit_event
|
||||
await emit_event(
|
||||
session,
|
||||
event_type="product.listed",
|
||||
aggregate_type="Product",
|
||||
aggregate_id=p.id,
|
||||
payload={
|
||||
"title": p.title or "",
|
||||
"description": getattr(p, "description", "") or "",
|
||||
},
|
||||
)
|
||||
|
||||
return p
|
||||
|
||||
# ---- API --------------------------------------------------------------------
|
||||
|
||||
2
shared
2
shared
Submodule shared updated: 8850a0106a...dd7a99e8b7
Reference in New Issue
Block a user