Stu Mason
Stu Mason

Activity

StuMason/cleanconnect
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

  • ReviewStatus enum (Draft/Published)
  • Review model with relationships to JobPosting, User (cleaner/client)
  • Migration with unique constraint per job/cleaner pair
  • ReviewData DTO for data transfer
  • ReviewPolicy for authorization (client can only review their own completed jobs)
  • CreateReview action for business logic
  • ReviewController with create/store endpoints
  • StoreReviewRequest for validation (rating 3-5, optional title/body)
  • ReviewPublished event for notification dispatch
  • ReviewPromptNotification and NewReviewReceivedNotification
  • Event listeners for JobCompleted and ReviewPublished

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