Skip to content

Commit 3f297e3

Browse files
authored
Merge pull request #96 from topcoder-platform/dev
[Hotfix PROD] - duplicated payments
2 parents 18e1b86 + 120fbc5 commit 3f297e3

6 files changed

Lines changed: 243 additions & 204 deletions

File tree

src/api/wallet/wallet.service.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,6 @@ export class WalletService {
8383
),
8484
unit: 'currency',
8585
},
86-
// hide rewards for now
87-
// {
88-
// type: WinningsType.REWARD,
89-
// amount: rewardTotal,
90-
// unit: 'points',
91-
// },
9286
],
9387
},
9488
withdrawalMethod: {
@@ -118,7 +112,7 @@ export class WalletService {
118112

119113
getWinningsTotalsByWinnerID(winnerId: string) {
120114
return this.prisma.$queryRaw<
121-
{ payment_type: 'PAYMENT' | 'REWARD'; total_owed: number }[]
115+
{ payment_type: 'PAYMENT'; total_owed: number }[]
122116
>`
123117
WITH latest_payment_version AS (
124118
SELECT
@@ -133,7 +127,6 @@ export class WalletService {
133127
w.type AS payment_type,
134128
CASE
135129
WHEN w.type = 'PAYMENT' THEN SUM(p.total_amount)
136-
WHEN w.type = 'REWARD' THEN SUM(r.points)
137130
ELSE 0
138131
END AS total_owed
139132
FROM
@@ -144,8 +137,6 @@ export class WalletService {
144137
AND p.installment_number = 1
145138
INNER JOIN latest_payment_version lpv ON p.winnings_id = lpv.winnings_id
146139
AND p.version = lpv.max_version
147-
LEFT JOIN reward r ON w.winning_id = r.winnings_id
148-
AND w.type = 'REWARD'
149140
WHERE
150141
w.winner_id = ${winnerId}
151142
GROUP BY

0 commit comments

Comments
 (0)