From 9df8327ed54a07d08e90466b0fa6770b5d0db3e1 Mon Sep 17 00:00:00 2001 From: Samuel Date: Thu, 29 Aug 2024 22:44:42 +0200 Subject: [PATCH] feat: fix migration --- src/migrations/1724855153990-seller-payouts.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/migrations/1724855153990-seller-payouts.ts b/src/migrations/1724855153990-seller-payouts.ts index 60c480c88..1761591f4 100644 --- a/src/migrations/1724855153990-seller-payouts.ts +++ b/src/migrations/1724855153990-seller-payouts.ts @@ -224,6 +224,7 @@ export class SellerPayouts1724855153990 implements MigrationInterface { .getRawOne(); const minCreatedAtDate = new Date(minCreatedAt.minCreatedAt); + minCreatedAtDate.setMilliseconds(0); const maxCreatedAtDate = new Date(maxCreatedAt.maxCreatedAt); const tillDate = new Date(maxCreatedAt.maxCreatedAt); tillDate.setSeconds(tillDate.getSeconds() + 1); @@ -233,7 +234,7 @@ export class SellerPayouts1724855153990 implements MigrationInterface { fromDate: minCreatedAtDate, tillDate, }); - console.error('report value of invoice', invoice.id, report.totalInclVat.toObject()); + console.error('report value of invoice', invoice.id, report.totalInclVat.toObject(), invoice.transfer.amountInclVat.getAmount(), maxCreatedAtDate, tillDate); assert(invoice.transfer.amountInclVat.equalsTo(report.totalInclVat), 'Migration of invoice would not match total'); const maxDate = new Date(maxCreatedAt.maxCreatedAt);