feat(miniapp): show payment activity in dashboard

This commit is contained in:
2026-03-10 17:16:16 +04:00
parent 1b490fa4a5
commit c292518760
7 changed files with 135 additions and 15 deletions

View File

@@ -61,7 +61,16 @@ function repository(
createdAt: instantFromIso('2026-03-12T12:00:00.000Z')
}
],
listPaymentRecordsForCycle: async () => [],
listPaymentRecordsForCycle: async () => [
{
id: 'payment-1',
memberId: member?.id ?? 'member-1',
kind: 'rent',
amountMinor: 50000n,
currency: 'GEL',
recordedAt: instantFromIso('2026-03-18T12:00:00.000Z')
}
],
listParsedPurchasesForRange: async () => [
{
id: 'purchase-1',
@@ -272,6 +281,8 @@ describe('createMiniAppDashboardHandler', () => {
period: '2026-03',
currency: 'GEL',
totalDueMajor: '2010.00',
totalPaidMajor: '500.00',
totalRemainingMajor: '1510.00',
rentSourceAmountMajor: '700.00',
rentSourceCurrency: 'USD',
rentDisplayAmountMajor: '1890.00',
@@ -279,6 +290,8 @@ describe('createMiniAppDashboardHandler', () => {
{
displayName: 'Stan',
netDueMajor: '2010.00',
paidMajor: '500.00',
remainingMajor: '1510.00',
rentShareMajor: '1890.00',
utilityShareMajor: '120.00',
purchaseOffsetMajor: '0.00'
@@ -294,6 +307,13 @@ describe('createMiniAppDashboardHandler', () => {
title: 'Electricity',
currency: 'GEL',
displayCurrency: 'GEL'
},
{
kind: 'payment',
title: 'rent',
paymentKind: 'rent',
currency: 'GEL',
displayCurrency: 'GEL'
}
]
}

View File

@@ -111,6 +111,7 @@ export function createMiniAppDashboardHandler(options: {
id: entry.id,
kind: entry.kind,
title: entry.title,
paymentKind: entry.paymentKind,
amountMajor: entry.amount.toMajorString(),
currency: entry.currency,
displayAmountMajor: entry.displayAmount.toMajorString(),