mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 17:34:03 +00:00
feat(miniapp): redesign member balance surfaces
This commit is contained in:
@@ -140,6 +140,7 @@ export interface FinanceDashboardLedgerEntry {
|
||||
export interface FinanceDashboard {
|
||||
period: string
|
||||
currency: CurrencyCode
|
||||
paymentBalanceAdjustmentPolicy: 'utilities' | 'rent' | 'separate'
|
||||
totalDue: Money
|
||||
totalPaid: Money
|
||||
totalRemaining: Money
|
||||
@@ -558,6 +559,7 @@ async function buildFinanceDashboard(
|
||||
return {
|
||||
period: cycle.period,
|
||||
currency: cycle.currency,
|
||||
paymentBalanceAdjustmentPolicy: settings.paymentBalanceAdjustmentPolicy ?? 'utilities',
|
||||
totalDue: settlement.totalDue,
|
||||
totalPaid: paymentRecords.reduce(
|
||||
(sum, payment) => sum.add(Money.fromMinor(payment.amountMinor, payment.currency)),
|
||||
|
||||
@@ -112,6 +112,7 @@ describe('createPaymentConfirmationService', () => {
|
||||
generateDashboard: async () => ({
|
||||
period: '2026-03',
|
||||
currency: 'GEL',
|
||||
paymentBalanceAdjustmentPolicy: 'utilities',
|
||||
totalDue: Money.fromMajor('1030', 'GEL'),
|
||||
totalPaid: Money.zero('GEL'),
|
||||
totalRemaining: Money.fromMajor('1030', 'GEL'),
|
||||
@@ -174,6 +175,7 @@ describe('createPaymentConfirmationService', () => {
|
||||
generateDashboard: async () => ({
|
||||
period: '2026-03',
|
||||
currency: 'GEL',
|
||||
paymentBalanceAdjustmentPolicy: 'utilities',
|
||||
totalDue: Money.fromMajor('1030', 'GEL'),
|
||||
totalPaid: Money.zero('GEL'),
|
||||
totalRemaining: Money.fromMajor('1030', 'GEL'),
|
||||
|
||||
Reference in New Issue
Block a user