Skip to content

feat(product-rating): implement product rating system#148

Merged
mohamedshemees merged 3 commits into
developmentfrom
product-review
Jun 17, 2026
Merged

feat(product-rating): implement product rating system#148
mohamedshemees merged 3 commits into
developmentfrom
product-review

Conversation

@mohamedshemees

Copy link
Copy Markdown
Contributor
  • Adds ProductRating entity, DTOs, and mapper

  • Implements ProductRatingService with review eligibility, editing, and deletion logic

  • Adds ProductRatingController with paginated endpoints

  • Adds Swagger documentation and SecurityScheme

- Adds ProductRating entity, DTOs, and mapper

- Implements ProductRatingService with review eligibility, editing, and deletion logic

- Adds ProductRatingController with paginated endpoints

- Adds Swagger documentation and SecurityScheme
@mohamedshemees mohamedshemees self-assigned this Jun 9, 2026
abdo-essam
abdo-essam previously approved these changes Jun 9, 2026
return orderItemRepository.existsByUserIdAndProductIdAndStatusIn(
userId,
productId,
listOf(OrderStatus.COMPLETED, OrderStatus.CANCELLED)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A person who never paid (cancelled order) can still leave a review
This is unfair to product owners
So we can remove OrderStatus.CANCELLED

@abdulazizacc abdulazizacc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done mohamed! keep going and please check the comment

Comment on lines +41 to +43
if (!canReview) {
throw IllegalStateException("You can only rate products you have purchased.")
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please replace this exception with custom one following the same pattern we are using

@mohamedshemees
mohamedshemees merged commit 03cb232 into development Jun 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants