mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage-server
synced 2026-05-18 20:08:19 +00:00
- QrService: generates QR PNG from appointment data, cached in-memory
- GET /api/messaging/qr/:appointmentId serves the image (Gupshup needs URL)
- sendImage added to MessagingProvider + GupshupProvider
- send_appointment_qr tool registered in ToolRegistry
- Flow JSON updated: QR sent after booking confirmation
- Variable interpolation now supports dot notation ({{result.field}})
- SIDECAR_PUBLIC_URL env var for the QR image URL
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
22 lines
924 B
TypeScript
22 lines
924 B
TypeScript
import { NormalizedMessage, InteractiveButton, ListSection } from '../types';
|
|
|
|
export abstract class MessagingProvider {
|
|
/** Parse raw webhook payload into normalized message */
|
|
abstract parseInbound(body: any): NormalizedMessage | null;
|
|
|
|
/** Send a plain text message */
|
|
abstract sendText(to: string, text: string): Promise<void>;
|
|
|
|
/** Send interactive buttons (max 3 for WhatsApp) */
|
|
abstract sendButtons(to: string, body: string, buttons: InteractiveButton[]): Promise<void>;
|
|
|
|
/** Send interactive list (max 10 rows total across sections) */
|
|
abstract sendList(to: string, body: string, buttonText: string, sections: ListSection[]): Promise<void>;
|
|
|
|
/** Send an image with optional caption */
|
|
abstract sendImage(to: string, imageUrl: string, caption?: string): Promise<void>;
|
|
|
|
/** Validate that inbound webhook is authentic */
|
|
abstract validateWebhook(body: any): boolean;
|
|
}
|