Feature/owner response to reviews 108#120
Open
Ceejaytech25 wants to merge 2 commits into
Open
Conversation
|
@Ceejaytech25 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Author
|
@Naomi-Gift , pls review |
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.
Description
This Pull Request introduces two significant functional enhancements to the Dongle Smart Contract, expanding community moderation capabilities and discoverability for projects.
Add Optional Project Owner Response to Reviews (#108)
Previously, project owners had no way to publicly respond to reviews on their projects, limiting context, moderation, and communication.
owner_responsetoReviewstruct so project owners can leave an optional response.respond_to_review: A secure method allowing only the verified project owner to add or update a response to a review.owner_responsedata when reviews are interacted with so indexers and frontends can catch updates immediately.get_review_responsegetter to fetch just the response tied to a review.Add Search and Filter Indexes for Categories (#110)
Previously, it was not possible to query projects grouped by their category without filtering on the frontend/indexer.
CategoryProjects(String)Storage Key: Introduced a dedicated mapping to track lists of project IDs for each category name.register_project: Appends the newly generated Project ID to its corresponding category index automatically.update_project: Securely removes the Project ID from the old category and transitions it to the new category if a project decides to switch categories.list_projects_by_category: Exposes a new deterministic, paginated getter to retrieve a list of projects efficiently under a specific category.CategoryProjectsindexes to prevent crucial lists from archiving out of ledger storage.Type of change
How Has This Been Tested?
Comprehensive testing suites were added and executed to assure data correctness, authorization, and pagination.
Owner Response to Reviews:
test_respond_to_review_success: Verified owners can successfully add responses and fetch them correctly.test_respond_to_review_unauthorized_fails: Ensured unauthorized wallets (non-owners) get appropriately rejected.test_respond_to_review_not_found_fails: Handled missing reviews elegantly.Category Indexing:
test_list_projects_by_category_basic: Validated registration naturally groups projects into their right categories.test_list_projects_by_category_update_moves_project: Asserted that updating a project correctly transitions the ID into the new category without leaving stale data.test_list_projects_by_category_pagination: Proved that chunking and deterministic pagination limit clauses are enforced safely without skipping or overlapping records.test_list_projects_by_category_empty: Confirmed empty returns occur smoothly on missing/unknown categories.Checklist:
Closes #108
Closes #110
Closes #105
Closes #111