Skip to content

Commit

Permalink
feat: fix migration
Browse files Browse the repository at this point in the history
  • Loading branch information
JustSamuel committed Aug 29, 2024
1 parent 652694c commit 9df8327
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/migrations/1724855153990-seller-payouts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 9df8327

Please sign in to comment.