feat(payments): track household payment confirmations

This commit is contained in:
2026-03-10 17:00:45 +04:00
parent fb85219409
commit 1988521931
31 changed files with 4795 additions and 19 deletions

View File

@@ -67,7 +67,7 @@ function bindRejectionMessage(
function bindTopicUsageMessage(
locale: BotLocale,
role: 'purchase' | 'feedback' | 'reminders'
role: 'purchase' | 'feedback' | 'reminders' | 'payments'
): string {
const t = getBotTranslations(locale).setup
@@ -78,12 +78,14 @@ function bindTopicUsageMessage(
return t.useBindFeedbackTopicInGroup
case 'reminders':
return t.useBindRemindersTopicInGroup
case 'payments':
return t.useBindPaymentsTopicInGroup
}
}
function bindTopicSuccessMessage(
locale: BotLocale,
role: 'purchase' | 'feedback' | 'reminders',
role: 'purchase' | 'feedback' | 'reminders' | 'payments',
householdName: string,
threadId: string
): string {
@@ -96,6 +98,8 @@ function bindTopicSuccessMessage(
return t.feedbackTopicSaved(householdName, threadId)
case 'reminders':
return t.remindersTopicSaved(householdName, threadId)
case 'payments':
return t.paymentsTopicSaved(householdName, threadId)
}
}
@@ -218,7 +222,7 @@ export function registerHouseholdSetupCommands(options: {
}): void {
async function handleBindTopicCommand(
ctx: Context,
role: 'purchase' | 'feedback' | 'reminders'
role: 'purchase' | 'feedback' | 'reminders' | 'payments'
): Promise<void> {
const locale = await resolveReplyLocale({
ctx,
@@ -455,6 +459,10 @@ export function registerHouseholdSetupCommands(options: {
await handleBindTopicCommand(ctx, 'reminders')
})
options.bot.command('bind_payments_topic', async (ctx) => {
await handleBindTopicCommand(ctx, 'payments')
})
options.bot.command('pending_members', async (ctx) => {
const locale = await resolveReplyLocale({
ctx,