feat(bot): add reminder utility entry flow

This commit is contained in:
2026-03-11 22:23:24 +04:00
parent 523b5144d8
commit 6b8c2fa397
10 changed files with 1473 additions and 18 deletions

View File

@@ -254,7 +254,33 @@ export const enBotTranslations: BotTranslationCatalog = {
reminders: {
utilities: (period) => `Utilities reminder for ${period}`,
rentWarning: (period) => `Rent reminder for ${period}: payment is coming up soon.`,
rentDue: (period) => `Rent due reminder for ${period}: please settle payment today.`
rentDue: (period) => `Rent due reminder for ${period}: please settle payment today.`,
guidedEntryButton: 'Guided entry',
copyTemplateButton: 'Copy template',
openDashboardButton: 'Open dashboard',
noActiveCategories:
'This household has no active utility categories yet. Use the dashboard to add them first.',
startToast: 'Guided utility entry started.',
templateToast: 'Utility template sent.',
promptAmount: (categoryName, currency, remainingCount) =>
`Reply with the amount for ${categoryName} in ${currency}. Send 0 or "skip" to leave it out.${remainingCount > 0 ? ` ${remainingCount} categories remain after this.` : ''}`,
invalidAmount: (categoryName, currency) =>
`I could not read that amount for ${categoryName}. Reply with a number in ${currency}, or send 0 / "skip".`,
templateIntro: (currency) =>
`Fill in the utility amounts below in ${currency}, then send the completed message back in this topic.`,
templateInstruction: 'Use 0 or skip for any category you want to leave empty.',
templateInvalid:
'I could not read any utility amounts from that template. Send the filled template back with at least one amount.',
summaryTitle: (period) => `Utility charges for ${period}`,
summaryLine: (categoryName, amount, currency) => `- ${categoryName}: ${amount} ${currency}`,
confirmPrompt: 'Confirm or cancel below.',
confirmButton: 'Save utility charges',
cancelButton: 'Cancel',
cancelled: 'Utility submission cancelled.',
saved: (count, period) =>
`Saved ${count} utility ${count === 1 ? 'charge' : 'charges'} for ${period}.`,
proposalUnavailable: 'This utility submission is no longer available.',
onlyOriginalSender: 'Only the person who started this utility submission can confirm it.'
},
purchase: {
sharedPurchaseFallback: 'shared purchase',

View File

@@ -258,7 +258,34 @@ export const ruBotTranslations: BotTranslationCatalog = {
reminders: {
utilities: (period) => `Напоминание по коммунальным платежам за ${period}`,
rentWarning: (period) => `Напоминание по аренде за ${period}: срок оплаты скоро наступит.`,
rentDue: (period) => `Напоминание по аренде за ${period}: пожалуйста, оплатите сегодня.`
rentDue: (period) => `Напоминание по аренде за ${period}: пожалуйста, оплатите сегодня.`,
guidedEntryButton: 'Ввести по шагам',
copyTemplateButton: 'Шаблон',
openDashboardButton: 'Открыть дашборд',
noActiveCategories:
'Для этого дома пока нет активных категорий коммуналки. Сначала добавьте их в дашборде.',
startToast: 'Пошаговый ввод коммуналки запущен.',
templateToast: 'Шаблон коммуналки отправлен.',
promptAmount: (categoryName, currency, remainingCount) =>
`Ответьте суммой для «${categoryName}» в ${currency}. Отправьте 0 или «пропуск», если эту категорию не нужно добавлять.${remainingCount > 0 ? ` После этого останется ещё ${remainingCount}.` : ''}`,
invalidAmount: (categoryName, currency) =>
`Не удалось распознать сумму для «${categoryName}». Отправьте число в ${currency} или 0 / «пропуск».`,
templateIntro: (currency) =>
`Заполните суммы по коммуналке ниже в ${currency}, затем отправьте заполненное сообщение обратно в этот топик.`,
templateInstruction:
'Для любой категории, которую не нужно добавлять, укажите 0 или слово «пропуск».',
templateInvalid:
'Не удалось распознать ни одной суммы в этом шаблоне. Отправьте заполненный шаблон хотя бы с одной суммой.',
summaryTitle: (period) => `Коммунальные начисления за ${period}`,
summaryLine: (categoryName, amount, currency) => `- ${categoryName}: ${amount} ${currency}`,
confirmPrompt: 'Подтвердите или отмените ниже.',
confirmButton: 'Сохранить коммуналку',
cancelButton: 'Отменить',
cancelled: 'Ввод коммуналки отменён.',
saved: (count, period) =>
`Сохранено ${count} ${count === 1 ? 'начисление коммуналки' : 'начислений коммуналки'} за ${period}.`,
proposalUnavailable: 'Это предложение по коммуналке уже недоступно.',
onlyOriginalSender: 'Подтвердить это добавление коммуналки может только тот, кто его начал.'
},
purchase: {
sharedPurchaseFallback: 'общая покупка',

View File

@@ -242,6 +242,26 @@ export interface BotTranslationCatalog {
utilities: (period: string) => string
rentWarning: (period: string) => string
rentDue: (period: string) => string
guidedEntryButton: string
copyTemplateButton: string
openDashboardButton: string
noActiveCategories: string
startToast: string
templateToast: string
promptAmount: (categoryName: string, currency: string, remainingCount: number) => string
invalidAmount: (categoryName: string, currency: string) => string
templateIntro: (currency: string) => string
templateInstruction: string
templateInvalid: string
summaryTitle: (period: string) => string
summaryLine: (categoryName: string, amount: string, currency: string) => string
confirmPrompt: string
confirmButton: string
cancelButton: string
cancelled: string
saved: (count: number, period: string) => string
proposalUnavailable: string
onlyOriginalSender: string
}
purchase: {
sharedPurchaseFallback: string