Skip to content

Commit 186adf6

Browse files
authored
fix: transaction summary to show received cores (#2788)
1 parent 080116e commit 186adf6

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

__tests__/njord.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1559,6 +1559,20 @@ describe('query transactionSummary', () => {
15591559
valueIncFees: 100,
15601560
createdAt: new Date(now.getTime() - 1000),
15611561
},
1562+
{
1563+
processor: UserTransactionProcessor.Njord,
1564+
receiverId: 't-tsq-1',
1565+
status: UserTransactionStatus.Success,
1566+
productId: null,
1567+
senderId: 't-tsq-2',
1568+
fee: 0,
1569+
value: 1000,
1570+
valueIncFees: 1000,
1571+
createdAt: new Date(now.getTime() - 1000),
1572+
request: {
1573+
origin: 'marketing',
1574+
},
1575+
},
15621576
]);
15631577
});
15641578

@@ -1581,7 +1595,7 @@ describe('query transactionSummary', () => {
15811595

15821596
expect(res.data.transactionSummary).toMatchObject({
15831597
purchased: 1300,
1584-
received: 285,
1598+
received: 1285,
15851599
spent: 200,
15861600
});
15871601
});

src/schema/njord.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ export const resolvers: IResolvers<unknown, BaseContext> = traceResolvers<
350350
.select('COALESCE(SUM(ut.valueIncFees), 0)', 'amount')
351351
.where('ut."receiverId" = :userId', { userId: ctx.userId })
352352
.andWhere('ut."senderId" IS NOT NULL')
353-
.andWhere('ut."productId" IS NOT NULL')
354353
.andWhere('ut.status = :status', {
355354
status: UserTransactionStatus.Success,
356355
})

0 commit comments

Comments
 (0)