feat: Review & Rating API#134
Merged
Merged
Conversation
- Add database schema migration for reviews with contract uniqueness constraints - Create POST /api/reviews endpoint to submit and validate freelancer reviews - Create GET /api/reviews/[userId] endpoint with pagination support - Author unit tests to verify constraint violations and paginated fetching logic
|
@Gezziy 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! 🚀 |
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.
closes #123
Summary of changes
This PR implements the Review and Rating API to manage freelancer feedback according to Issue #123.
009-reviews-schema.sqlwhich explicitly defines the schema, mappingcontract_idto user relationships.POST /api/reviewsallowing clients to submit reviews containing a rating (1-5), verified byzodschema parsing.GET /api/reviews/[userId]that fetches paginated results using dynamicLIMIT/OFFSETqueries, executing efficiently in a single database round-trip via window functions.__tests__/api/reviews.test.tsto assert uniqueness bounds, data types, and routing logic.Reason for the changes
To guarantee fair, validated feedback within the TaskChain ecosystem. By tying reviews to explicit contracts and enforcing uniqueness, we avoid system manipulation, allowing top-performing freelancers to build a transparent track record that clients can trust.