Skip to main content
Kin Conecta’s review system enables tourists to share their experiences and helps future travelers make informed decisions.

Overview

The review system consists of:

Reviews

Tourist reviews with ratings and comments

Review Replies

Guide responses to reviews

Social Features

Likes and engagement metrics

Reviews

Reviews are feedback from tourists after completing a tour.

Data Model

// Model: Review.java
package org.generation.socialNetwork.reviews.model;

@Entity
@Table(name = "reviews")
public class Review {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long reviewId;
    
    private Long tripId;      // The completed trip
    private Long tourId;      // The tour that was reviewed
    private Long guideId;     // The guide being reviewed
    private Long touristId;   // Who wrote the review
    
    private Integer rating;   // Numeric rating (typically 1-5)
    private String comment;   // Written review text
    
    private Integer likesCount;   // Number of likes
    private Integer repliesCount; // Number of replies
    
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
    private LocalDateTime deletedAt;  // Soft delete support
}

Key Features

Trip Association

Reviews are linked to specific completed trips

Rating Scale

Numeric rating system (typically 1-5 stars)

Text Feedback

Detailed written comments from tourists

Soft Deletes

Reviews can be removed but data is preserved

Rating System

While the database stores ratings as integers, the typical implementation uses a 5-star scale:
  • 5 stars - Excellent
  • 4 stars - Good
  • 3 stars - Average
  • 2 stars - Below Average
  • 1 star - Poor
The rating field is flexible and can support different scales (e.g., 1-10) if needed.

Social Engagement

Likes: Other users can like reviews they find helpful
  • Stored in likesCount field
  • Helps surface useful reviews
Replies: Counted in repliesCount field
  • Shows how engaged the guide is with feedback
  • Includes guide replies and potentially tourist responses

Soft Deletion

Reviews use soft deletion for moderation:
private LocalDateTime deletedAt;  // null = active, non-null = deleted
Benefits:
  • Preserve rating calculations
  • Maintain referential integrity
  • Allow restoration if deleted in error
  • Support moderation workflows
When querying reviews, filter for deletedAt IS NULL to show only active reviews.

Review Replies

Guides can respond to reviews to address feedback or thank tourists.

Data Model

// Model: ReviewReply.java
@Entity
@Table(name = "review_replies")
public class ReviewReply {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long replyId;
    
    private Long reviewId;    // Parent review
    private Long guideId;     // Who replied (typically the guide)
    
    private String message;   // Reply content
    
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
}

Key Features

  • One-to-Many: Multiple replies can exist per review
  • Guide Ownership: Typically only guides reply to their reviews
  • Timestamps: Track when replies are created and edited
  • Updates: Guides can edit their replies
Showing that a guide responds to reviews builds trust and demonstrates active engagement with customers.

Best Practices for Replies

Timely Response

Reply to reviews within 24-48 hours

Professional Tone

Maintain professional, courteous language

Address Concerns

Acknowledge negative feedback constructively

Thank Positive Reviews

Show appreciation for good reviews

Integration with Other Features

Impact on Guide Profiles

Reviews automatically update guide statistics:
// GuideProfile.java
private BigDecimal ratingAvg;     // Average of all review ratings
private Integer reviewsCount;     // Total number of reviews
Calculation:
-- Calculate average rating
SELECT AVG(rating) as rating_avg, COUNT(*) as reviews_count
FROM reviews
WHERE guide_id = ? AND deleted_at IS NULL

Impact on Tour Listings

Tours also display aggregated ratings:
// Tour.java
private BigDecimal ratingAvg;     // Average rating for this tour
private Integer bookingsCount;    // Total bookings (includes reviews)

Review Eligibility

Tourists can only review trips that:
  1. Have status = COMPLETED
  2. They participated in (touristId matches)
  3. Haven’t already been reviewed by them
Prevent duplicate reviews: Check if a review already exists for the trip+tourist combination before allowing a new review.

API Endpoints

Reviews

GET    /api/v1/reviews
GET    /api/v1/reviews/{id}
POST   /api/v1/reviews
PUT    /api/v1/reviews/{id}
DELETE /api/v1/reviews/{id}
Common Query Parameters:
  • ?guideId={id} - Get reviews for a guide
  • ?tourId={id} - Get reviews for a tour
  • ?touristId={id} - Get reviews by a tourist
  • ?tripId={id} - Get review for a specific trip
  • ?minRating={n} - Filter by minimum rating

Review Replies

GET    /api/v1/review-replies
GET    /api/v1/review-replies/{id}
POST   /api/v1/review-replies
PUT    /api/v1/review-replies/{id}
DELETE /api/v1/review-replies/{id}
Common Query Parameters:
  • ?reviewId={id} - Get replies for a review
  • ?guideId={id} - Get all replies by a guide

Usage Examples

Creating a Review

POST /api/v1/reviews
{
  "tripId": 789,
  "tourId": 42,
  "guideId": 456,
  "touristId": 123,
  "rating": 5,
  "comment": "Amazing experience! The guide was knowledgeable and friendly. Highly recommend this tour!",
  "createdAt": "2024-06-16T10:00:00Z"
}

Guide Replying to Review

POST /api/v1/review-replies
{
  "reviewId": 555,
  "guideId": 456,
  "message": "Thank you so much for the wonderful review! It was a pleasure showing you around Tokyo. Hope to see you again soon!",
  "createdAt": "2024-06-16T15:30:00Z"
}

// Update review reply count
PUT /api/v1/reviews/555
{
  "repliesCount": 1
}

Updating Guide Rating Average

-- Calculate new average after review is created
UPDATE guide_profiles
SET rating_avg = (
  SELECT AVG(rating)
  FROM reviews
  WHERE guide_id = 456 AND deleted_at IS NULL
),
reviews_count = (
  SELECT COUNT(*)
  FROM reviews
  WHERE guide_id = 456 AND deleted_at IS NULL
)
WHERE user_id = 456;

Soft Deleting a Review

PUT /api/v1/reviews/555
{
  "deletedAt": "2024-06-20T09:00:00Z"
}

// Recalculate guide ratings after deletion

Review Display & Sorting

Common Sorting Options

Most Recent

Sort by createdAt DESC

Highest Rated

Sort by rating DESC

Most Helpful

Sort by likesCount DESC

With Replies

Sort by repliesCount DESC

Review Filtering

Common filters for review lists:
// Show only 5-star reviews
GET /api/v1/reviews?guideId=456&rating=5

// Show reviews with photos (if implemented)
GET /api/v1/reviews?guideId=456&hasPhotos=true

// Show verified reviews (from completed trips)
GET /api/v1/reviews?guideId=456&verified=true

Moderation & Quality

Review Guidelines

Reviews should:
  • Be based on actual experience
  • Be respectful and constructive
  • Avoid profanity or hate speech
  • Not include personal contact information
  • Not be spam or promotional content

Moderation Actions

Users can flag inappropriate reviews for moderator review. Flagged reviews are reviewed by platform administrators.
Moderators can soft delete reviews that violate guidelines by setting deletedAt timestamp.
Tourists can edit their reviews within a time window (e.g., 7 days). The updatedAt timestamp tracks edits.

Review Verification

Verified reviews come from actual completed bookings:
// Check if review is verified
const isVerified = review.tripId && 
  tripBooking.status === 'COMPLETED' &&
  tripBooking.touristId === review.touristId;
Verified reviews are more trustworthy and can be highlighted in the UI with a verification badge.

Analytics & Insights

For Guides

Guides can track:
  • Average Rating: Overall rating average
  • Rating Distribution: Count of 1-5 star reviews
  • Response Rate: Percentage of reviews with guide replies
  • Review Trends: Rating changes over time
  • Common Themes: Frequently mentioned topics

For Platform

Platform administrators can monitor:
  • Overall Rating Distribution: Platform-wide quality metrics
  • Top Rated Guides: Identify and promote excellent guides
  • Problem Detection: Identify guides with declining ratings
  • Review Volume: Track engagement and platform health

Best Practices

Prompt for reviews shortly after trip completion while the experience is fresh. Send a notification or email 1-2 days after the trip ends.
Prevent review manipulation: Only allow verified tourists who completed a trip to leave reviews. Prevent guides from reviewing themselves.
Display reviews prominently on guide and tour pages to help tourists make informed decisions. Include average rating, total reviews, and recent reviews.

Review Incentives

  • Badge or points for tourists who leave reviews
  • Highlight helpful reviews with likes
  • Feature detailed, photo-rich reviews
  • Thank tourists for feedback

Common Questions

Yes, tourists can update their reviews using the PUT /api/v1/reviews/{id} endpoint. The updatedAt timestamp records when the review was last modified.
No, guides cannot delete reviews. Only platform administrators can remove reviews that violate community guidelines. This maintains review authenticity.
The guide’s rating_avg is calculated as the average of all non-deleted review ratings. It’s automatically updated when reviews are created, edited, or deleted.
No, reviews require a tripId linking to a completed trip. This ensures all reviews are from verified experiences.
Reviews are typically preserved for historical accuracy and transparency, but marked appropriately if the guide is no longer active.

Trip Bookings

Learn how completed trips enable reviews

Guide Profiles

See how ratings appear on guide profiles

Build docs developers (and LLMs) love