Task #80
openRating & Review Feature for Listings
0%
Description
Implement a Rating and Review system that allows users to rate and review Ads, Business Listings, and Skill/Service Listings. Ratings should help other users understand the quality and reliability of a listing. The system must calculate and display the average rating for each listing and allow users to submit one rating per listing.
***Tables Used
***ratings
Field Description
id (PK) Rating ID
user_id (FK users.id) User who submitted the rating
listing_type ad / business / service
listing_id Related listing ID
rating Rating value (1–5)
review Review text (optional)
is_active Active / Inactive
created_at Timestamp
***ads
Field Description
id (PK) Ad ID
average_rating Calculated average rating
total_ratings Number of ratings
***business_listings
Field Description
id (PK) Business ID
average_rating Calculated average rating
total_ratings Number of ratings
***skill_service_listings
Field Description
id (PK) Service listing ID
average_rating Calculated average rating
total_ratings Number of ratings
***Validations / Rules
*Rating value must be between 1 and 5
*A user can submit only one rating per listing
*User cannot rate their own listing
*Review text is optional but:
*Max length: 500 characters
*Only:
*Approved listings
*Active listings
*can be rated
*Average rating must be:
*Auto-calculated
*Updated after each new rating
*Editing a rating should recalculate the average