feat: review summary generation (P0 #6)#8
Merged
Merged
Conversation
P0 roadmap item #6 — per-product AI summary of approved customer reviews (summary/pros/cons/themes/reviewCount/averageRating) via chatStructured. - ReviewSummaryGenerator: master + feature flag + provider gates, fetches up to 50 approved reviews (status=true, createdAt DESC, content capped at 500 chars each) from product_review.repository - POST /api/_action/frosh-ai/product/review-summary {productId} - GET /api/_action/frosh-ai/product/review-summary-status - FeatureId::ReviewSummary + featureReviewSummary config checkbox (en/de) - Admin UI / storefront output intentionally left for follow-ups
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds AI-generated per-product review summaries — P0 roadmap item #6, and the flagship Shopware-Copilot-parity wedge (Copilot's review summary is paywalled behind Rise+). Summarizes a product's approved reviews into a concise summary + pros/cons/themes + average rating, using the structured output support added in #4.
Changes
ReviewSummaryGenerator(src/Feature/ReviewSummary/): master + per-feature flag gates + provider availability; fetches up to 50 approved reviews (status=true,createdAt DESC, title/content/points) viaproduct_review.repository; throws on zero reviews; callsAiClient::chatStructuredwith a schema forsummary,pros[],cons[],themes[],reviewCount,averageRating; returns the structured result + provider/model.ReviewSummaryController:POST /api/_action/frosh-ai/product/review-summary+GET .../review-summary-status.FeatureId::ReviewSummary+featureReviewSummaryconfig checkbox (en + de-DE).Tests
ReviewSummaryGeneratorTest(7 tests): master-off / flag-off / no-provider / zero-reviews / invalid-structured-output / success (full payload) /isEnabled(). UpdatedFeatureFlagsTest(7→8 flags).113 tests / 438 assertions, green — locally and in the
frosh-ai-devcontainer (Shopware 6.7 / PHP 8.3).Notes
Capability::StructuredOutput, so it prefers providers/models with structured-output support (Anthropic, Mistral, OpenAI, Gemini).