From eaa0f48e425cacb52824cbf14432cc83f409da99 Mon Sep 17 00:00:00 2001 From: koresar Date: Wed, 15 May 2024 21:16:27 +1000 Subject: [PATCH] Revert "fix: use the last most record in the DB as the balance snapshot upper boundary" This reverts commit d37951d26708f1f9c961a0d9255b2854cbde764b. --- src/Book.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Book.ts b/src/Book.ts index ba84288..8d1a5e4 100644 --- a/src/Book.ts +++ b/src/Book.ts @@ -22,6 +22,7 @@ const GROUP = { _id: null, balance: { $sum: { $subtract: ["$credit", "$debit"] } }, notes: { $sum: 1 }, + lastTransactionId: { $max: "$_id" }, }, }; @@ -109,9 +110,6 @@ export class Book