Add the experience service with sites through analytics/AI hooks, migrations through 0011, and phase docs/manifests marking the track complete. Co-authored-by: Cursor <cursoragent@cursor.com>
94 lines
2.7 KiB
Python
94 lines
2.7 KiB
Python
"""No-op mock provider implementations — Phase 11.9.
|
|
|
|
Used by consumer connector dispatches and notify send flows. No real network
|
|
calls or cross-service imports.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
from uuid import UUID, uuid4
|
|
|
|
|
|
class MockCommunicationProvider:
|
|
async def send(
|
|
self,
|
|
*,
|
|
tenant_id: UUID,
|
|
channel: str,
|
|
template_key: str,
|
|
to: str,
|
|
payload: dict[str, Any],
|
|
) -> dict[str, Any]:
|
|
return {
|
|
"ok": True,
|
|
"provider": "mock_communication",
|
|
"communication_request_ref": f"communication:request:{uuid4()}",
|
|
"channel": channel,
|
|
"template_key": template_key,
|
|
"to": to,
|
|
"tenant_id": str(tenant_id),
|
|
"payload": payload,
|
|
}
|
|
|
|
|
|
class MockNotificationProvider:
|
|
async def notify(
|
|
self,
|
|
*,
|
|
tenant_id: UUID,
|
|
channel: str,
|
|
template_key: str,
|
|
payload: dict[str, Any],
|
|
) -> dict[str, Any]:
|
|
return {
|
|
"ok": True,
|
|
"provider": "mock_notification",
|
|
"communication_request_ref": f"communication:request:{uuid4()}",
|
|
"channel": channel,
|
|
"template_key": template_key,
|
|
"tenant_id": str(tenant_id),
|
|
"payload": payload,
|
|
}
|
|
|
|
|
|
class MockHospitalityProvider:
|
|
async def resolve_menu_ref(
|
|
self, *, tenant_id: UUID, menu_ref: str
|
|
) -> dict[str, Any]:
|
|
return {"ok": True, "menu_ref": menu_ref, "provider": "mock_hospitality"}
|
|
|
|
|
|
class MockMarketplaceProvider:
|
|
async def resolve_product_ref(
|
|
self, *, tenant_id: UUID, product_ref: str
|
|
) -> dict[str, Any]:
|
|
return {"ok": True, "product_ref": product_ref, "provider": "mock_marketplace"}
|
|
|
|
|
|
class MockSportsCenterProvider:
|
|
async def resolve_member_ref(
|
|
self, *, tenant_id: UUID, member_ref: str
|
|
) -> dict[str, Any]:
|
|
return {"ok": True, "member_ref": member_ref, "provider": "mock_sports_center"}
|
|
|
|
|
|
class MockCRMProvider:
|
|
async def resolve_contact(
|
|
self, *, tenant_id: UUID, contact_ref: str
|
|
) -> dict[str, Any]:
|
|
return {"ok": True, "contact_ref": contact_ref, "provider": "mock_crm"}
|
|
|
|
|
|
class MockAIProvider:
|
|
async def generate_content(
|
|
self, *, tenant_id: UUID, task: str, context: dict[str, Any]
|
|
) -> dict[str, Any]:
|
|
return {
|
|
"ok": True,
|
|
"provider": "mock_ai",
|
|
"generated_content_ref": f"ai:content:{uuid4()}",
|
|
"task": task,
|
|
"tenant_id": str(tenant_id),
|
|
"context": context,
|
|
}
|