From 55b86809233821cb442594e4f5982ac63860a802 Mon Sep 17 00:00:00 2001 From: Kartik Datrika Date: Thu, 16 Apr 2026 12:50:33 +0530 Subject: [PATCH] AI Summary not showing appointments fix. --- src/call-events/call-lookup.controller.ts | 2 +- src/platform/platform-graphql.service.ts | 2 + src/platform/platform.types.ts | 112 +++++++++++----------- 3 files changed, 60 insertions(+), 56 deletions(-) diff --git a/src/call-events/call-lookup.controller.ts b/src/call-events/call-lookup.controller.ts index 90bd9c1..be04ff6 100644 --- a/src/call-events/call-lookup.controller.ts +++ b/src/call-events/call-lookup.controller.ts @@ -58,7 +58,7 @@ export class CallLookupController { // Fetch patient context if patientId exists let patientData = null; let upcomingAppointments: any[] = []; - if (lead.patientId) { + if (lead?.patientId) { try { patientData = await this.platform.getPatientWithToken( lead.patientId, diff --git a/src/platform/platform-graphql.service.ts b/src/platform/platform-graphql.service.ts index 58280ae..ce14c28 100644 --- a/src/platform/platform-graphql.service.ts +++ b/src/platform/platform-graphql.service.ts @@ -97,6 +97,7 @@ export class PlatformGraphqlService { assignedAgent campaignId adId contactAttempts spamScore isSpam aiSummary aiSuggestedAction + patientId } }`, { id }, @@ -162,6 +163,7 @@ export class PlatformGraphqlService { assignedAgent campaignId adId contactAttempts spamScore isSpam aiSummary aiSuggestedAction + patientId } } } diff --git a/src/platform/platform.types.ts b/src/platform/platform.types.ts index d0fef6f..f157fc8 100644 --- a/src/platform/platform.types.ts +++ b/src/platform/platform.types.ts @@ -1,72 +1,74 @@ export type LeadNode = { - id: string; - createdAt: string; - contactName: { firstName: string; lastName: string } | null; - contactPhone: { number: string; callingCode: string }[] | null; - contactEmail: { address: string }[] | null; - leadSource: string | null; - leadStatus: string | null; - interestedService: string | null; - assignedAgent: string | null; - campaignId: string | null; - adId: string | null; - contactAttempts: number | null; - spamScore: number | null; - isSpam: boolean | null; - aiSummary: string | null; - aiSuggestedAction: string | null; + id: string; + createdAt: string; + contactName: { firstName: string; lastName: string } | null; + contactPhone: { number: string; callingCode: string }[] | null; + contactEmail: { address: string }[] | null; + leadSource: string | null; + leadStatus: string | null; + interestedService: string | null; + assignedAgent: string | null; + campaignId: string | null; + adId: string | null; + contactAttempts: number | null; + spamScore: number | null; + isSpam: boolean | null; + aiSummary: string | null; + aiSuggestedAction: string | null; + patientId: string | null; }; export type LeadActivityNode = { - id: string; - activityType: string | null; - summary: string | null; - occurredAt: string | null; - performedBy: string | null; - channel: string | null; + id: string; + activityType: string | null; + summary: string | null; + occurredAt: string | null; + performedBy: string | null; + channel: string | null; }; export type CallNode = { - id: string; - callDirection: string | null; - callStatus: string | null; - disposition: string | null; - agentName: string | null; - startedAt: string | null; - endedAt: string | null; - durationSeconds: number | null; - leadId: string | null; + id: string; + callDirection: string | null; + callStatus: string | null; + disposition: string | null; + agentName: string | null; + startedAt: string | null; + endedAt: string | null; + durationSeconds: number | null; + leadId: string | null; }; export type CreateCallInput = { - callDirection: string; - callStatus: string; - callerNumber?: { number: string; callingCode: string }[]; - agentName?: string; - startedAt?: string; - endedAt?: string; - durationSeconds?: number; - disposition?: string; - callNotes?: string; - leadId?: string; - sla?: number; + callDirection: string; + callStatus: string; + callerNumber?: { number: string; callingCode: string }[]; + agentName?: string; + startedAt?: string; + endedAt?: string; + durationSeconds?: number; + disposition?: string; + callNotes?: string; + leadId?: string; + sla?: number; }; export type CreateLeadActivityInput = { - activityType: string; - summary: string; - occurredAt: string; - performedBy: string; - channel: string; - durationSeconds?: number; - outcome?: string; - leadId: string; + activityType: string; + summary: string; + occurredAt: string; + performedBy: string; + channel: string; + durationSeconds?: number; + outcome?: string; + leadId: string; }; export type UpdateLeadInput = { - leadStatus?: string; - lastContactedAt?: string; - aiSummary?: string; - aiSuggestedAction?: string; - contactAttempts?: number; + leadStatus?: string; + lastContactedAt?: string; + aiSummary?: string; + aiSuggestedAction?: string; + contactAttempts?: number; + patientId?: string; };