-
Couldn't load subscription status.
- Fork 1
PM-1105 - Checkpoint winners #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| generateWinnersPayments(challenge: Challenge): PaymentPayload[] { | ||
| const { prizeSets, winners } = challenge; | ||
|
|
||
| generateWinnersPayments( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[correctness]
The function signature has been changed to accept winners and prizes as separate parameters, but the original challenge parameter already contains these properties. This change could lead to redundancy and potential inconsistencies if the winners or prizes parameters differ from those in the challenge object. Consider using the properties directly from the challenge object to maintain consistency and reduce the risk of errors.
| 'desc', | ||
| ); | ||
|
|
||
| if ((checkpointPrizes?.length ?? 0) < (checkpointWinners?.length ?? 0)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[maintainability]
The error message could be more informative by including the actual numbers of checkpoint winners and prizes. Consider including these values to aid debugging.
| ); | ||
| } | ||
|
|
||
| if (!checkpointPrizes?.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[💡 maintainability]
The check for !checkpointPrizes?.length is redundant since the previous condition already ensures that checkpointPrizes has at least as many elements as checkpointWinners. Consider removing this check to simplify the code.
| overview: PrizeOverview; | ||
| winners: Winner[]; // Replace with type if needed | ||
| winners: Winner[]; | ||
| checkpointWinners: Winner[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[correctness]
Consider adding validation or constraints to ensure that checkpointWinners is correctly populated and does not contain duplicates or invalid entries. This will help maintain data integrity and prevent potential issues with incorrect winner data.
https://topcoder.atlassian.net/browse/PM-1105 - handle challenge checkpoint winners