fix(bot): improve calculated purchase confirmation flow

This commit is contained in:
2026-03-12 15:35:02 +04:00
parent 995725f121
commit 014d791bdc
8 changed files with 708 additions and 70 deletions

View File

@@ -288,8 +288,12 @@ export const enBotTranslations: BotTranslationCatalog = {
purchase: {
sharedPurchaseFallback: 'shared purchase',
processing: 'Checking that purchase...',
proposal: (summary, participants) =>
`I think this shared purchase was: ${summary}.${participants ? `\n\n${participants}` : ''}\nConfirm or cancel below.`,
proposal: (summary: string, calculationNote: string | null, participants: string | null) =>
`I think this shared purchase was: ${summary}.${calculationNote ? `\n${calculationNote}` : ''}${participants ? `\n\n${participants}` : ''}\nConfirm or cancel below.`,
calculatedAmountNote: (explanation: string | null) =>
explanation
? `I calculated the total as ${explanation}. Is that right?`
: 'I calculated the total for this purchase. Is that right?',
clarification: (question) => question,
clarificationMissingAmountAndCurrency:
'What amount and currency should I record for this shared purchase?',
@@ -304,7 +308,13 @@ export const enBotTranslations: BotTranslationCatalog = {
participantToggleIncluded: (displayName) => `${displayName}`,
participantToggleExcluded: (displayName) => `${displayName}`,
confirmButton: 'Confirm',
calculatedConfirmButton: 'Looks right',
calculatedFixAmountButton: 'Fix amount',
cancelButton: 'Cancel',
calculatedFixAmountPrompt:
'Reply with the corrected total and currency in this topic, and I will re-check the purchase.',
calculatedFixAmountRequestedToast: 'Reply with the corrected total.',
calculatedFixAmountAlreadyRequested: 'Waiting for the corrected total.',
confirmed: (summary) => `Purchase confirmed: ${summary}`,
cancelled: (summary) => `Purchase proposal cancelled: ${summary}`,
confirmedToast: 'Purchase confirmed.',