-
Notifications
You must be signed in to change notification settings - Fork 6
feat: earn section skip rewards #131
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
feat: earn section skip rewards #131
Conversation
| name: "QuizClaimInput", | ||
| fields: () => ({ | ||
| id: { type: GT.NonNull(GT.ID) }, | ||
| skipRewards: { type: GT.Boolean }, |
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.
default must be here
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.
skipRewards: { type: GT.Boolean, defaultValue: false },
| }, | ||
| resolve: async (_, args, { domainAccount, ip }) => { | ||
| const { id } = args.input | ||
| const { id, skipRewards = false } = args.input |
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.
default must be in the input
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.
Done!
Description
This PR updates the quiz claim logic to support a
skipRewardsflag. WhenskipRewardsistrue, the system bypasses key validations and payment steps, allowing quiz completion without errors or rewards.Changes:
skipRewardsflag to the quiz claim input.skipRewardsistrue, the following errors are omitted and no payment is processed:InvalidPhoneForQuizError(Unsupported phone carrier)InvalidIpMetadataError(Unsupported IP)QuizClaimedTooEarlyError(Daily section limit)NotEnoughBalanceForQuizError(Insufficient wallet funds)skipRewardsisfalse, all validations and payments occur as usual.