From 248f6b51eacd4e11572237b9427d29ba2db62d8d Mon Sep 17 00:00:00 2001 From: kevin-asprec Date: Wed, 6 May 2026 07:22:36 +0800 Subject: [PATCH] fix: include invoice id in unremitted payments query MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The invoice select was missing `id`, causing InvoiceSummary.fromJson to crash on null — silently swallowing the error and showing an empty unremitted list in the mobile app. --- src/payment/payment.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/payment/payment.service.ts b/src/payment/payment.service.ts index 9fad73e..54dcfe1 100644 --- a/src/payment/payment.service.ts +++ b/src/payment/payment.service.ts @@ -169,7 +169,7 @@ export class PaymentService { where: { tenantId, collectedById: collectorId, id: { notIn: remittedIds.length > 0 ? remittedIds : ['none'] } }, include: { client: { select: { firstName: true, lastName: true, accountNumber: true } }, - invoice: { select: { number: true } }, + invoice: { select: { id: true, number: true } }, }, orderBy: { createdAt: 'desc' }, });