Fix: Checkpoint prizes are not shown for challenges with checkpoint phase#1756
Open
loigaak wants to merge 1 commit into
Open
Fix: Checkpoint prizes are not shown for challenges with checkpoint phase#1756loigaak wants to merge 1 commit into
loigaak wants to merge 1 commit into
Conversation
…hase This commit addresses GitHub Issue topcoder-platform#1096 by ensuring checkpoint prizes are correctly structured and displayed. Key changes include: - In `CheckpointPrizes-Field`, individual prizes within the `CHECKPOINT_PRIZES` prize set are now explicitly assigned the `CHALLENGE_PRIZE_TYPE.CHECKPOINT` type. - The display currency symbol for checkpoint prizes is now consistently derived from the main challenge's prize type (USD or POINT). - The `getPrizeType` utility function has been enhanced to robustly determine the challenge's currency type, ignoring `CHECKPOINT` as a currency. - The `applyPrizeTypeToPrizeSets` utility function is updated to only modify `PLACEMENT` and `COPILOT_PAYMENT` prize types, preserving the `CHECKPOINT` type for checkpoint prizes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1096
This PR addresses the issue where checkpoint prizes were not correctly displayed or handled for challenges with a checkpoint phase.
The changes include:
CheckpointPrizes-Fieldto ensure that individual prizes within theCHECKPOINT_PRIZESprize set are correctly assigned theCHALLENGE_PRIZE_TYPE.CHECKPOINTtype.getPrizeTypeutility function to reliably returnUSDorPOINTbased onPLACEMENTorCOPILOT_PAYMENTprize sets, preventingCHECKPOINTfrom being misinterpreted as a currency type.applyPrizeTypeToPrizeSetsto only modify thetypeof prizes withinPLACEMENTandCOPILOT_PAYMENTprize sets, leavingCHECKPOINTprize types untouched.These changes ensure that checkpoint prizes are correctly structured in the challenge object and displayed with the appropriate currency symbol, aligning with the issue's requirements.