Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions 8cbc_backend/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions 8cbc_backend/controllers/calls/calls.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,17 @@ const CallsController = () => {
"Other",
]),
reason: z.string().optional(),
aiSolutionsSummary: z.string().optional(),
escalationReason: z.string().optional(),
conversationContext: z.string().optional(),
}).pick({
slotId: true,
phoneNumber: true,
category: true,
reason: true,
aiSolutionsSummary: true,
escalationReason: true,
conversationContext: true,
});

// Create Slot
Expand Down
4 changes: 4 additions & 0 deletions 8cbc_backend/database/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,10 @@ export const callBookingsTable = pgTable("call_bookings", {
reason: text("reason"),
status: callStatusEnum("status").notNull().default("Pending"),
assignedAgentId: integer("assigned_agent_id").references(() => usersTable.id),
// AI Context Handoff fields (invisible to customer, visible to support agents)
aiSolutionsSummary: text("ai_solutions_summary"), // What the AI tried
escalationReason: text("escalation_reason"), // Why AI couldn't resolve
conversationContext: text("conversation_context"), // Key context for agent
createdAt: timestamp("created_at").defaultNow().notNull(),
updatedAt: timestamp("updated_at").defaultNow().notNull(),
});
Expand Down
3 changes: 3 additions & 0 deletions 8cbc_backend/drizzle/0017_next_whirlwind.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE "call_bookings" ADD COLUMN "ai_solutions_summary" text;--> statement-breakpoint
ALTER TABLE "call_bookings" ADD COLUMN "escalation_reason" text;--> statement-breakpoint
ALTER TABLE "call_bookings" ADD COLUMN "conversation_context" text;
Loading
Loading