mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage-server
synced 2026-04-11 18:08:16 +00:00
- CallEventsService orchestrates: Exotel webhook → lead lookup → AI enrichment → WebSocket push - CallEventsGateway (Socket.IO /call-events namespace) with agent room registration and disposition handling - EnrichedCallEvent/DispositionPayload types for frontend contract - Disposition flow: creates Call record, updates lead status, logs lead activity - Wired ExotelController to forward answered/ended events to CallEventsService - forwardRef used to resolve circular dependency between gateway and service Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
39 lines
915 B
TypeScript
39 lines
915 B
TypeScript
export type EnrichedCallEvent = {
|
|
callSid: string;
|
|
eventType: 'ringing' | 'answered' | 'ended';
|
|
lead: {
|
|
id: string;
|
|
firstName: string;
|
|
lastName: string;
|
|
phone: string;
|
|
email?: string;
|
|
source?: string;
|
|
status?: string;
|
|
campaign?: string;
|
|
interestedService?: string;
|
|
age: number;
|
|
aiSummary?: string;
|
|
aiSuggestedAction?: string;
|
|
recentActivities: {
|
|
activityType: string;
|
|
summary: string;
|
|
occurredAt: string;
|
|
performedBy: string;
|
|
}[];
|
|
} | null;
|
|
callerPhone: string;
|
|
agentName: string;
|
|
timestamp: string;
|
|
};
|
|
|
|
export type DispositionPayload = {
|
|
callSid: string;
|
|
leadId: string | null;
|
|
disposition: string;
|
|
notes: string;
|
|
agentName: string;
|
|
callerPhone: string;
|
|
startedAt: string;
|
|
duration: number;
|
|
};
|