mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 20:24:03 +00:00
feat(payments): add transparent balance guidance
This commit is contained in:
@@ -267,6 +267,8 @@ export const enBotTranslations: BotTranslationCatalog = {
|
||||
payments: {
|
||||
topicMissing:
|
||||
'Payments topic is not configured for this household yet. Ask an admin to run /bind_payments_topic.',
|
||||
balanceReply: (kind) =>
|
||||
kind === 'rent' ? 'Current rent payment guidance:' : 'Current utilities payment guidance:',
|
||||
proposal: (kind, amount, currency) =>
|
||||
`I can record this ${kind === 'rent' ? 'rent' : 'utilities'} payment: ${amount} ${currency}. Confirm or cancel below.`,
|
||||
clarification:
|
||||
@@ -274,6 +276,24 @@ export const enBotTranslations: BotTranslationCatalog = {
|
||||
unsupportedCurrency:
|
||||
'I can only record payments in the household settlement currency for this topic right now.',
|
||||
noBalance: 'There is no payable balance for that payment type right now.',
|
||||
breakdownBase: (kind, amount, currency) =>
|
||||
`${kind === 'rent' ? 'Rent due' : 'Utilities due'}: ${amount} ${currency}`,
|
||||
breakdownPurchaseBalance: (amount, currency) => `Purchase balance: ${amount} ${currency}`,
|
||||
breakdownSuggestedTotal: (amount, currency, policy) =>
|
||||
`Suggested payment under ${policy}: ${amount} ${currency}`,
|
||||
breakdownRecordingAmount: (amount, currency) =>
|
||||
`Amount from your message: ${amount} ${currency}`,
|
||||
breakdownRemaining: (amount, currency) => `Total remaining balance: ${amount} ${currency}`,
|
||||
adjustmentPolicy: (policy) =>
|
||||
policy === 'utilities'
|
||||
? 'utilities adjustment'
|
||||
: policy === 'rent'
|
||||
? 'rent adjustment'
|
||||
: 'separate purchase settlement',
|
||||
timingBeforeWindow: (kind, reminderDate, dueDate) =>
|
||||
`${kind === 'rent' ? 'Rent' : 'Utilities'} are not due yet. Next reminder: ${reminderDate}. Due date: ${dueDate}.`,
|
||||
timingDueNow: (kind, dueDate) =>
|
||||
`${kind === 'rent' ? 'Rent' : 'Utilities'} are due now. Due date: ${dueDate}.`,
|
||||
confirmButton: 'Confirm payment',
|
||||
cancelButton: 'Cancel',
|
||||
recorded: (kind, amount, currency) =>
|
||||
|
||||
@@ -270,6 +270,8 @@ export const ruBotTranslations: BotTranslationCatalog = {
|
||||
payments: {
|
||||
topicMissing:
|
||||
'Для этого дома ещё не настроен топик оплат. Попросите админа выполнить /bind_payments_topic.',
|
||||
balanceReply: (kind) =>
|
||||
kind === 'rent' ? 'Текущая сводка по аренде:' : 'Текущая сводка по коммуналке:',
|
||||
proposal: (kind, amount, currency) =>
|
||||
`Я могу записать эту оплату ${kind === 'rent' ? 'аренды' : 'коммуналки'}: ${amount} ${currency}. Подтвердите или отмените ниже.`,
|
||||
clarification:
|
||||
@@ -277,6 +279,25 @@ export const ruBotTranslations: BotTranslationCatalog = {
|
||||
unsupportedCurrency:
|
||||
'Сейчас я могу записывать оплаты в этом топике только в валюте расчётов по дому.',
|
||||
noBalance: 'Сейчас для этого типа оплаты нет суммы к подтверждению.',
|
||||
breakdownBase: (kind, amount, currency) =>
|
||||
`${kind === 'rent' ? 'Аренда к оплате' : 'Коммуналка к оплате'}: ${amount} ${currency}`,
|
||||
breakdownPurchaseBalance: (amount, currency) =>
|
||||
`Баланс по общим покупкам: ${amount} ${currency}`,
|
||||
breakdownSuggestedTotal: (amount, currency, policy) =>
|
||||
`Рекомендуемая сумма по политике «${policy}»: ${amount} ${currency}`,
|
||||
breakdownRecordingAmount: (amount, currency) =>
|
||||
`Сумма из вашего сообщения: ${amount} ${currency}`,
|
||||
breakdownRemaining: (amount, currency) => `Общий остаток: ${amount} ${currency}`,
|
||||
adjustmentPolicy: (policy) =>
|
||||
policy === 'utilities'
|
||||
? 'зачёт через коммуналку'
|
||||
: policy === 'rent'
|
||||
? 'зачёт через аренду'
|
||||
: 'отдельный расчёт по покупкам',
|
||||
timingBeforeWindow: (kind, reminderDate, dueDate) =>
|
||||
`${kind === 'rent' ? 'Аренду' : 'Коммуналку'} пока рано оплачивать. Следующее напоминание: ${reminderDate}. Срок оплаты: ${dueDate}.`,
|
||||
timingDueNow: (kind, dueDate) =>
|
||||
`${kind === 'rent' ? 'Аренду' : 'Коммуналку'} уже пора оплачивать. Срок оплаты: ${dueDate}.`,
|
||||
confirmButton: 'Подтвердить оплату',
|
||||
cancelButton: 'Отменить',
|
||||
recorded: (kind, amount, currency) =>
|
||||
|
||||
@@ -254,11 +254,24 @@ export interface BotTranslationCatalog {
|
||||
}
|
||||
payments: {
|
||||
topicMissing: string
|
||||
balanceReply: (kind: 'rent' | 'utilities') => string
|
||||
recorded: (kind: 'rent' | 'utilities', amount: string, currency: string) => string
|
||||
proposal: (kind: 'rent' | 'utilities', amount: string, currency: string) => string
|
||||
clarification: string
|
||||
unsupportedCurrency: string
|
||||
noBalance: string
|
||||
breakdownBase: (kind: 'rent' | 'utilities', amount: string, currency: string) => string
|
||||
breakdownPurchaseBalance: (amount: string, currency: string) => string
|
||||
breakdownSuggestedTotal: (amount: string, currency: string, policy: string) => string
|
||||
breakdownRecordingAmount: (amount: string, currency: string) => string
|
||||
breakdownRemaining: (amount: string, currency: string) => string
|
||||
adjustmentPolicy: (policy: 'utilities' | 'rent' | 'separate') => string
|
||||
timingBeforeWindow: (
|
||||
kind: 'rent' | 'utilities',
|
||||
reminderDate: string,
|
||||
dueDate: string
|
||||
) => string
|
||||
timingDueNow: (kind: 'rent' | 'utilities', dueDate: string) => string
|
||||
confirmButton: string
|
||||
cancelButton: string
|
||||
cancelled: string
|
||||
|
||||
Reference in New Issue
Block a user