Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions src/api/challenges/challenges.service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import {
includes,
isEmpty,
sortBy,
find,
camelCase,
groupBy,
orderBy,
} from 'lodash';
import { includes, isEmpty, find, camelCase, groupBy, orderBy } from 'lodash';
import { Injectable } from '@nestjs/common';
import { ENV_CONFIG } from 'src/config';
import { Logger } from 'src/shared/global';
Expand Down Expand Up @@ -76,7 +68,7 @@ export class ChallengesService {
};
} catch (e) {
this.logger.error(
`Challenge resources for challenge ${challengeId} couldn\'t be fetched!`,
`Challenge resources for challenge ${challengeId} couldn't be fetched!`,
e,
);
}
Expand Down Expand Up @@ -164,10 +156,11 @@ export class ChallengesService {
handle: reviewer.memberHandle,
userId: reviewer.memberId.toString(),
amount: Math.round(
(challengeReviewer.basePayment ?? 0) +
((challengeReviewer.incrementalPayment ?? 0) / 100) *
challenge.numOfSubmissions *
firstPlacePrize,
(challengeReviewer.fixedAmount ?? 0) +
(challengeReviewer.baseCoefficient ?? 0) * firstPlacePrize +
(challengeReviewer.incrementalCoefficient ?? 0) *
firstPlacePrize *
challenge.numOfSubmissions,
),
type: WinningsCategory.REVIEW_BOARD_PAYMENT,
});
Expand Down Expand Up @@ -200,7 +193,7 @@ export class ChallengesService {
billingAccountId: challenge.billing.billingAccountId,
payroll: includes(
TGBillingAccounts,
challenge.billing.billingAccountId,
+challenge.billing.billingAccountId,
),
},
}));
Expand Down
5 changes: 3 additions & 2 deletions src/api/challenges/models/challenge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ export interface Reviewer {
scorecardId: string;
isMemberReview: boolean;
memberReviewerCount?: number;
basePayment?: number;
incrementalPayment?: number;
baseCoefficient?: number;
incrementalCoefficient?: number;
fixedAmount?: number;
isAIReviewer: boolean;
}

Expand Down