TidyLinker.com
TypeScript
Pull Request Opened
PR #52 opened: Add reviews system for client feedback on completed jobs
Summary
- Implement reviews feature allowing clients to rate cleaners (3-5 stars) after completed jobs
- Reviews display on cleaner public profiles and contribute to their overall rating
- Includes review prompt notification on job completion and new review notification for cleaners
Changes
Backend
ReviewStatusenum (Draft/Published)Reviewmodel with relationships to JobPosting, User (cleaner/client)- Migration with unique constraint per job/cleaner pair
ReviewDataDTO for data transferReviewPolicyfor authorization (client can only review their own completed jobs)CreateReviewaction for business logicReviewControllerwith create/store endpointsStoreReviewRequestfor validation (rating 3-5, optional title/body)ReviewPublishedevent for notification dispatchReviewPromptNotificationandNewReviewReceivedNotification- Event listeners for
JobCompletedandReviewPublished
Frontend
- Review form page with 3-5 star rating selector (
Review.tsx) - Updated job show page with "Leave Review" button for completed jobs
- Reviews display on cleaner public profile with star ratings
- Real rating/review count calculations from published reviews
Tests
- 23 comprehensive tests covering:
- Access control (client only, job owner only, completed jobs only)
- Review submission validation
- Model relationships and scopes
- has_review flag on job show page
Test plan
- All 23 review feature tests pass
- All existing client tests pass (64 tests)
- Pre-commit hooks pass (Pint, Prettier, ESLint)
- Manual test: Complete a job, submit review, verify display on cleaner profile
+1951
additions
-22
deletions
25
files changed