mirror of
https://github.com/whekin/household-bot.git
synced 2026-04-01 07:24:02 +00:00
feat: add quick payment action and improve copy button UX
Mini App Home Screen: - Add 'Record Payment' button to utilities and rent period cards - Pre-fill payment amount with member's share (rentShare/utilityShare) - Modal dialog with amount input and currency display - Toast notifications for copy and payment success/failure feedback Copy Button Improvements: - Increase spacing between icon and text (4px → 8px) - Add hover background and padding for better touch target - Green background highlight when copied (in addition to icon color change) - Toast notification appears when copying any value Backend: - Add /api/miniapp/payments/add endpoint for quick payments - Payment notifications sent to 'reminders' topic in Telegram - Include member name, payment type, amount, and period in notification Files: - New: apps/miniapp/src/components/ui/toast.tsx - Modified: apps/miniapp/src/routes/home.tsx, apps/miniapp/src/index.css, apps/miniapp/src/theme.css, apps/miniapp/src/i18n.ts, apps/bot/src/miniapp-billing.ts, apps/bot/src/server.ts Quality Gates: ✅ format, lint, typecheck, build, test Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -10,7 +10,8 @@ import type {
|
||||
HouseholdConfigurationRepository,
|
||||
HouseholdMemberAbsencePolicy,
|
||||
HouseholdMemberAbsencePolicyRecord,
|
||||
HouseholdMemberRecord
|
||||
HouseholdMemberRecord,
|
||||
HouseholdRentPaymentDestination
|
||||
} from '@household/ports'
|
||||
import {
|
||||
BillingCycleId,
|
||||
@@ -144,9 +145,12 @@ export interface FinanceDashboard {
|
||||
period: string
|
||||
currency: CurrencyCode
|
||||
timezone: string
|
||||
rentWarningDay: number
|
||||
rentDueDay: number
|
||||
utilitiesReminderDay: number
|
||||
utilitiesDueDay: number
|
||||
paymentBalanceAdjustmentPolicy: 'utilities' | 'rent' | 'separate'
|
||||
rentPaymentDestinations: readonly HouseholdRentPaymentDestination[] | null
|
||||
totalDue: Money
|
||||
totalPaid: Money
|
||||
totalRemaining: Money
|
||||
@@ -577,9 +581,12 @@ async function buildFinanceDashboard(
|
||||
period: cycle.period,
|
||||
currency: cycle.currency,
|
||||
timezone: settings.timezone,
|
||||
rentWarningDay: settings.rentWarningDay,
|
||||
rentDueDay: settings.rentDueDay,
|
||||
utilitiesReminderDay: settings.utilitiesReminderDay,
|
||||
utilitiesDueDay: settings.utilitiesDueDay,
|
||||
paymentBalanceAdjustmentPolicy: settings.paymentBalanceAdjustmentPolicy ?? 'utilities',
|
||||
rentPaymentDestinations: settings.rentPaymentDestinations ?? null,
|
||||
totalDue: settlement.totalDue,
|
||||
totalPaid: paymentRecords.reduce(
|
||||
(sum, payment) => sum.add(Money.fromMinor(payment.amountMinor, payment.currency)),
|
||||
|
||||
Reference in New Issue
Block a user