Skip to content

Submit Review Logic #54

Closed
Closed

Description

@Bosun-Josh121

Target Contract: reputation-scoring-contract
Labels: phase-3-reputation, core-logic, cross-contract

Description: The core module function. A user submits a 1-5 star review. This issue handles bounding, cross-contract payment verification, spam prevention, and state updates.

Tasks:

  • src/types.rs: Define ExpertStats { total_score: u64, total_reviews: u64 }.
  • src/error.rs: Add InvalidScore = 4, InvalidBookingState = 5, UserMismatch = 6, AlreadyReviewed = 7.
  • src/storage.rs: Map DataKey::ExpertStats(Address) -> ExpertStats and DataKey::ReviewExists(u64) -> bool.
  • src/contract.rs: Implement submit_review(env, user, expert, booking_id, score: u32, review_uri: String).
    • Require user.require_auth(). Check score >= 1 && score <= 5.
    • Assert !storage::is_paused().
    • Cross-Contract: Invoke Vault's get_booking. Assert status is Complete, and addresses match.
    • Spam Check: Assert ReviewExists(booking_id) is false. Flag it as true.
    • State Update: Add score to total_score, increment total_reviews.
  • src/events.rs: Implement review_submitted(expert, user, booking_id, score, review_uri).
  • src/lib.rs: Expose submit_review and get_expert_stats.
  • src/test.rs: Mock Vault. Test success path, invalid score failure, and duplicate review panic.

Acceptance Criteria:

  • Immutable, verified, and spam-resistant review logic is fully operational.

Activity

  1. deleted a comment from on Mar 27, 2026
  2. EA10-lite commented on Mar 27, 2026

    @EA10-lite

    @EA10-lite has applied to work on this issue as part of the Stellar Wave Program's 3rd wave.

    Hi, I'd like to work on this issue.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @EA10-lite to this issue.

  3. deleted a comment from wheval on Mar 28, 2026
  4. arandomogg commented on Mar 29, 2026

    @arandomogg

    @arandomogg has applied to work on this issue as part of the Stellar Wave Program's 3rd wave.

    I can help resolve this issue, please assign it to me.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @arandomogg to this issue.

  5. drips-wave commented on Mar 29, 2026

    @drips-wave

    Congratulations, @arandomogg! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on March 30, 2026.

    🧑‍💻 @arandomogg: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  6. added a commit that references this issue on Mar 29, 2026
    ec7fb06
  7. added a commit that references this issue on Jul 30, 2026
    24ec245
  8. grantfox-oss commented on Aug 20, 2026

    @grantfox-oss

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

    @arandomogg's PR #61 was approved and merged by @Luluameh.

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

    👏 Great work, @arandomogg! Keep contributing to LightForgeHub.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions