fix: include invoice id in unremitted payments query

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.
This commit is contained in:
kevin-asprec
2026-05-06 07:22:36 +08:00
parent 5f4a4c6874
commit 248f6b51ea

View File

@@ -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' },
});