Skip to main content

Reviews & Ratings

Concordia’s review system enables customers to rate and review services with threaded discussion support, moderation workflow, and provider response capabilities.

Overview

The review system is implemented in src/database/schemas/services_reviews.schema.ts and provides:
  • Star ratings (1-5 scale)
  • Written review content
  • Threaded replies (provider responses)
  • Moderation workflow
  • Multi-language support

Review Schema

From src/database/schemas/services_reviews.schema.ts:

Review Fields

Identification

text
required
Unique review identifier
text
required
Reference to the service being reviewed
text
Parent review ID for threaded replies
  • null for root reviews (customer reviews)
  • Set to parent review ID for replies (provider responses)

Author Information

text
required
Display name of the reviewerExample: "John Smith"
text
required
Email address of the reviewerUsed for notifications, not displayed publicly
text
Optional authenticated user IDLinks review to user account if authenticated
Reviews can be left by authenticated users (with authorId) or guests (authenticated via email verification).

Review Content

jsonb
required
Review text as structured JSONSupports rich text formatting, allowing paragraphs, lists, etc.Example:
integer
required
Star rating on a scaleTypically 1-5 stars, where:
  • 1 = Very poor
  • 2 = Poor
  • 3 = Average
  • 4 = Good
  • 5 = Excellent
text
required
ISO 639-1 language code of the reviewExample: "fr", "en", "es"
Root reviews (customer reviews) must have a rating value. Replies (provider responses) can have rating set to 0 or omit rating logic.

Moderation

text
default:"pending"
Review moderation status:
  • pending - Awaiting moderator approval
  • approved - Visible to public
  • rejected - Hidden, rejected by moderator

Timestamps

timestamp
required
When the review was submitted
timestamp
required
Last modification time (automatically updated)

Threaded Replies

The schema supports threaded discussions through the parentId field:

Review Structure

Each customer review can have multiple provider replies. This enables ongoing conversation and clarification.

Review Workflow

Customer Review Process

  1. Customer completes booking - Booking status must be completed
  2. Customer writes review - Submits rating and written feedback
  3. Review enters moderation - Status: pending
  4. Moderator reviews - Checks for spam, inappropriate content
  5. Approval decision:
    • Approved → Status: approved, visible to public
    • Rejected → Status: rejected, hidden

Provider Response Process

  1. Review is approved - Customer review visible
  2. Provider writes response - Creates reply with parentId
  3. Response moderation - Status: pending
  4. Moderator approves - Status: approved
  5. Response displayed - Shown under original review
Provider responses also go through moderation to ensure professional, appropriate communication.

Example Review & Reply

Customer Review (Root)

Provider Response (Reply)

Database Indexes

From services_reviews.schema.ts:

Index Usage

Fast retrieval of all reviews for a serviceQuery: SELECT * FROM services_reviews WHERE service_id = ? AND status = 'approved'
Moderation queue queriesQuery: SELECT * FROM services_reviews WHERE status = 'pending' ORDER BY created_at
Filter reviews by rating levelQuery: SELECT * FROM services_reviews WHERE service_id = ? AND rating >= 4
Retrieve all replies for a reviewQuery: SELECT * FROM services_reviews WHERE parent_id = ?
User’s review historyQuery: SELECT * FROM services_reviews WHERE author_id = ?

Integration with Bookings

From the specifications, reviews should only be allowed for completed bookings:
Always verify that the reviewer has actually used the service before allowing review submission. Check for a completed booking.

Moderation Guidelines

Approve Reviews That:

  • Provide honest, constructive feedback
  • Are based on actual service experience
  • Use respectful language
  • Include specific details about the service

Reject Reviews That:

  • Contain profanity or hate speech
  • Are spam or promotional content
  • Include personal attacks
  • Are from users without completed bookings
  • Contain false or misleading information
Moderators should review both customer reviews and provider responses to maintain a professional, helpful review section.

Review Aggregation

From services_listings.schema.ts, services can cache aggregate rating data:
Trigger rating recalculation when reviews are approved, rejected, or deleted to keep aggregate data accurate.

Display Logic

Showing Reviews

Sorting Options

  • Most Recent: ORDER BY created_at DESC
  • Highest Rated: ORDER BY rating DESC, created_at DESC
  • Lowest Rated: ORDER BY rating ASC, created_at DESC
  • Most Helpful: Requires additional helpful votes system

Best Practices

For Customers

  1. Be specific - Mention particular aspects of the service
  2. Be fair - Balance pros and cons
  3. Be timely - Review soon after service completion
  4. Be respectful - Critique service, not person

For Providers

  1. Respond professionally - Thank customers, address concerns
  2. Be timely - Respond within 24-48 hours
  3. Be constructive - Turn negative reviews into learning opportunities
  4. Don’t argue - Stay professional even with unfair reviews

For Moderators

  1. Review promptly - Process within 24 hours
  2. Be consistent - Apply guidelines uniformly
  3. Be fair - Consider context and intent
  4. Document reasons - Note why reviews are rejected

For Developers

  1. Verify booking completion - Check completed booking before allowing review
  2. Prevent duplicates - One review per customer per service
  3. Sanitize content - Clean HTML/scripts from review text
  4. Send notifications - Notify provider of new reviews, customer of responses
  5. Cache aggregates - Update service average rating on review changes