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>
This commit is contained in:
2026-04-20 20:23:06 +05:30
parent 300fff25c1
commit d819888351
11 changed files with 313 additions and 18 deletions

View File

@@ -13,6 +13,9 @@ export abstract class MessagingProvider {
/** 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;
}