Overview
PM-41 adds PM-owned analytics tables (pm_analytics_*), funnel aggregates, risk scores, and dashboard/API surfaces. Persistence for immutable logs is via database triggers (or equivalent synchronous paths) on CE/PM source tables; FW-16 is used for realtime UI subscriptions and downstream notifications (e.g. PM-42), not as the sole write path for logs (see spec Clarifications).
Platform Integration Pattern
- Inbound: CE-28 screening completion, PM-38 appointments, PM-39 waitlist lifecycle — materialized into
pm_analytics_*_logtables. - Outbound: Aggregates and risk events consumed by PM-42 (coordinator workbench); compliance CSV exports may be referenced by GR attestation workflows.
- Tenant isolation: All tables
organization_id+ RLS; dashboard gated bypm.intake_funnel.view.
Event & Data Contracts
Payload shapes: see
EVENT_CONTRACTS.md and CE-28 Integration, CE-29 Integration as applicable.
API / Edge Surface
- Funnel and exports: Supabase RPC or Edge Function with JWT + org validation; logical shape
GET /api/analytics/pm-41/funnelin spec maps to implementation-time route naming.
Related Documents
- CROSS_CORE_INTEGRATIONS.md — integration matrix
- CONTRACT_VALIDATION_CHECKLIST.md