fix(bot): localize topic processor responses and allow optional payment amounts

This commit is contained in:
2026-03-15 02:27:44 +04:00
parent 3c53ab9e1a
commit afbda43c0e
3 changed files with 36 additions and 14 deletions

View File

@@ -15,7 +15,7 @@ import type {
} from '@household/ports'
import { createDbClient, schema } from '@household/db'
import { getBotTranslations, type BotLocale } from './i18n'
import { getBotTranslations, botLocaleFromContext, type BotLocale } from './i18n'
import type { AssistantConversationMemoryStore } from './assistant-state'
import { buildConversationContext } from './conversation-orchestrator'
import type {
@@ -2298,9 +2298,10 @@ export function registerPurchaseTopicIngestion(
rememberUserTurn(options.memoryStore, record)
typingIndicator =
options.interpreter && route.shouldStartTyping ? startTypingIndicator(ctx) : null
const locale = botLocaleFromContext(ctx)
const pendingReply =
options.interpreter && shouldShowProcessingReply(ctx, record, route)
? await sendPurchaseProcessingReply(ctx, getBotTranslations('en').purchase.processing)
? await sendPurchaseProcessingReply(ctx, getBotTranslations(locale).purchase.processing)
: null
const result = await repository.save(record, options.interpreter, 'GEL')