Files
helix-engage-server/src/messaging/providers/messaging-provider.interface.ts
saridsa2 d819888351 feat: appointment QR code — generated and sent via WhatsApp after booking
- 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>
2026-04-20 20:23:06 +05:30

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;
}