fix(messaging): parse postbackText from Gupshup list_reply, pass selection ID to AI

Gupshup list_reply has empty id field — postbackText carries our ID.
Fixed ?? to || fallback. Also inject selection_id into user message so
AI can extract doctorId from "doc:{uuid}:{name}" format.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-20 15:25:35 +05:30
parent b1922809d0
commit c4c437abd6
3 changed files with 11 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ export class MessagingController {
@Post('webhook')
async webhook(@Body() body: any) {
this.logger.log(`[WA-WEBHOOK] Received: ${JSON.stringify(body).substring(0, 300)}`);
this.logger.log(`[WA-WEBHOOK] Received: ${JSON.stringify(body).substring(0, 500)}`);
if (!this.provider.validateWebhook(body)) {
this.logger.warn('[WA-WEBHOOK] Validation failed — ignoring');