export type AiConvStatus = | "ai-active" | "manual" | "needs-attention" | "closed"; export type AiConvMessageRole = "bot" | "visitor" | "advisor" | "system"; export type AiConvFieldConfidence = "confirmed" | "estimated"; export type AiConvFilterTab = | "all" | "emails" | "ai-active" | "needs-attention" | "closed"; export type AiConvMode = "ai" | "manual"; export type AiConvChannel = "chat" | "email"; export type AiConvChannelFilter = "all" | AiConvChannel; export type AiConvMeetingType = "video" | "phone" | "in-person"; export interface AiConvContact { id: string; name: string; email?: string; phone?: string; } export interface AiConvAdvisor { id: string; name: string; initials: string; role?: string; } export interface AiConvListItemData { id: string; contact: AiConvContact; status: AiConvStatus; lastMessage: string; lastMessageRole?: AiConvMessageRole; timestamp: string; unreadCount?: number; /** Assigned advisor display name. */ assignedTo?: string; /** * Conversation topic tag — e.g. "Buy a Home", "Refinance", "Investment". * Shown as a small secondary badge so the broker can categorise conversations * at a glance without opening each thread. */ topic?: string; /** Channel this conversation is using — "chat" (default) or "email". */ channel?: AiConvChannel; /** * Latest email subject for this conversation — shown as the row title by * the "row" list-item variant (Gmail-style embedded lists). */ subject?: string; } export interface AiConvAttachment { id: string; name: string; /** Human-readable size, e.g. "248 KB". */ size: string; /** Download URL — omitted for attachments staged locally, not yet uploaded. */ url?: string; } export interface AiConvMessage { id: string; role: AiConvMessageRole; content: string; /** Files attached to this message (email channel only). */ attachments?: AiConvAttachment[]; timestamp?: string; /** Display name shown above the bubble. */ senderName?: string; /** Email subject line — shown as a header in the bubble for email-channel messages. */ subject?: string; } export interface AiConvDataField { label: string; value: string; confidence: AiConvFieldConfidence; } export interface AiConvMeetingActionItem { label: string; done?: boolean; } export interface AiConvAppointmentData { datetime: string; meetingType: AiConvMeetingType; /** Meeting link (video), phone number (phone), or address (in-person). */ meetingDetail?: string; status: "requested" | "confirmed" | "pending" | "cancelled"; /** AI recap of the meeting — shown once it has been recorded and summarised. */ summary?: string; /** Follow-up items from the meeting, optionally marked done. */ actionItems?: AiConvMeetingActionItem[]; }