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

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