Skip to content

[QuestEngine] Make batch review payout logic match single review #88

Description

@Kaylahray

Description

The batch approval flow should execute the same payout rules as single submission review, including platform fees, staking multiplier handling, pause checks, and consistent status transitions.

User Story

As an Employer,
I want to batch approve submissions with the exact same payout logic as single approval,
so that bulk approvals do not behave differently from individual approvals.

Requirements and Context

  • Files: contracts/quest-engine/src/lib.rs, contracts/quest-engine/src/test.rs
  • Refactor batch_review_submissions so each learner path reuses the same core approval logic as review_submission
  • Apply the same fee transfer and staking multiplier logic used by the single-review path
  • Keep batch event emission while avoiding drift between the two approval paths
  • Ensure submission status and auth checks remain identical for batch and single review

Suggested Implementation

// 1. Extract the common approval flow into an internal helper.
// 2. Call the helper from review_submission.
// 3. Reuse the helper inside batch_review_submissions for each learner.
// 4. Keep BatchReviewed as the aggregate event after all learner approvals succeed.

Acceptance Criteria

  • Batch approval applies the same fee and multiplier behavior as single approval.
  • A change to single-review payout rules does not require duplicating the logic in a second place.
  • Batch review tests cover mixed multiplier tiers and failure cases.

Submission Guidelines

  • Branch: feat/batch-review-parity
  • Depends on: [QuestEngine] Deliver uncapped staking multiplier payouts
  • PR: refactor(quest-engine): unify batch and single review payout logic

Activity

  1. syed-ghufran-hassan commented on Jul 31, 2026

    @syed-ghufran-hassan
    Contributor

    Refactored batch_review_submissions to call the same process_submission_approval helper as review_submission, ensuring consistent fee/multiplier handling and adding 10 passing tests. Please assign the issue to me

  2. Muhammadjazuli commented on Aug 19, 2026

    @Muhammadjazuli
    Contributor

    I’d like to work on this. The main thing I’d focus on is removing the duplicated payout logic so batch review can’t drift from review_submission over time.

    I’ll extract the shared approval path, use it from both flows, and keep the batch-specific event handling intact. I’ll also add tests around different staking multipliers and failure cases to make sure both paths behave the same.

  3. grantfox-oss commented on Aug 20, 2026

    @grantfox-oss

    🦊 GrantFox — @Muhammadjazuli has been assigned to this issue as part of the Third Campaign campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #88)
    2. Your PR will be reviewed by the learnault maintainers

    Good luck! Track your progress on GrantFox.

  4. grantfox-oss commented on Aug 21, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox as part of the Third Campaign campaign!

    @Muhammadjazuli's PR #110 was approved and merged by @3m1n3nc3.

    🏆 @Muhammadjazuli: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (570 total points). Track your full progress on GrantFox.

    👏 Great work, @Muhammadjazuli! Keep contributing to learnault.

  5. added a commit that references this issue on Aug 29, 2026
    d7c2bce
  6. grantfox-oss commented on Aug 29, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox as part of the Third Campaign campaign!

    @syed-ghufran-hassan's PR #107 was approved and merged by @3m1n3nc3.

    🏆 @syed-ghufran-hassan: You earned 40 FoxPoints for this contribution! Your current tier: Builder (1,823 total points). Track your full progress on GrantFox.

    👏 Great work, @syed-ghufran-hassan! Keep contributing to learnault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions