Skip to content

Conversation

@vas3a
Copy link
Collaborator

@vas3a vas3a commented Oct 27, 2025

https://topcoder.atlassian.net/browse/PM-2561

based on slack discussion, points challenges are handled on topgear's side. skipping payments creation completely for other types of prizes (other than USD)

@vas3a vas3a requested a review from kkartunov October 27, 2025 08:12
}

const paymentTypes = [
...new Set(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ performance]
Using new Set followed by spreading into an array is a common pattern for deduplication, but it might be more efficient to use a single reduce operation to build the array directly without intermediate structures. Consider using reduce to accumulate unique payment types.

.flat(),
),
];
const isRewardsPayment = paymentTypes.some((type) => type !== 'USD');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The variable isRewardsPayment is determined by checking if any payment type is not 'USD'. This logic might be misleading if there are mixed types (e.g., both 'USD' and another type). Ensure that the logic aligns with the intended business rule.

@vas3a vas3a merged commit a47cee7 into v6 Oct 27, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants