mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage-server
synced 2026-05-18 20:08:19 +00:00
- EventBusService: Kafka/Redpanda pub/sub with kafkajs, graceful fallback when broker unavailable - Topics: call.completed, call.missed, agent.state - AiInsightConsumer: on call.completed, fetches lead activity → OpenAI generates summary + suggested action → updates Lead entity on platform - Disposition endpoint emits call.completed event after Ozonetel dispose - EventsModule registered as @Global for cross-module injection - Redpanda container added to VPS docker-compose - Docker image rebuilt for linux/amd64 with kafkajs dependency Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
37 lines
806 B
TypeScript
37 lines
806 B
TypeScript
// Event topic names
|
|
export const Topics = {
|
|
CALL_COMPLETED: 'call.completed',
|
|
CALL_MISSED: 'call.missed',
|
|
AGENT_STATE: 'agent.state',
|
|
} as const;
|
|
|
|
// Event payloads
|
|
export type CallCompletedEvent = {
|
|
callId: string | null;
|
|
ucid: string;
|
|
agentId: string;
|
|
callerPhone: string;
|
|
direction: string;
|
|
durationSec: number;
|
|
disposition: string;
|
|
leadId: string | null;
|
|
notes: string | null;
|
|
timestamp: string;
|
|
};
|
|
|
|
export type CallMissedEvent = {
|
|
callId: string | null;
|
|
callerPhone: string;
|
|
leadId: string | null;
|
|
leadName: string | null;
|
|
timestamp: string;
|
|
};
|
|
|
|
export type AgentStateEvent = {
|
|
agentId: string;
|
|
state: string;
|
|
timestamp: string;
|
|
};
|
|
|
|
export type EventPayload = CallCompletedEvent | CallMissedEvent | AgentStateEvent;
|