-
Notifications
You must be signed in to change notification settings - Fork 4
Add product reviews #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
b21cb6d
Add product reviews
DennisGarding dd35bf3
Add package annotation
DennisGarding 0f922e2
Add more reviews
DennisGarding 26a7d2c
Add smoke test
DennisGarding a8cef4c
PHPStan
DennisGarding d3a4c81
Fix PHPStan
DennisGarding 651e700
Fix PHPSta
DennisGarding 5712a2a
Change to static ids
DennisGarding 6a5a434
Change namspace
DennisGarding 5682679
Fix tests
DennisGarding 72c5afe
Fix tests
DennisGarding 66b6590
Fix tests
DennisGarding a18f60c
Fix tests
DennisGarding 3e04c18
Fix tests
DennisGarding 552399b
Fix tests
DennisGarding 568c5bd
Fix tests
DennisGarding e617aa6
Fix tests
DennisGarding File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,177 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
| /* | ||
| * (c) shopware AG <info@shopware.com> | ||
| * For the full copyright and license information, please view the LICENSE | ||
| * file that was distributed with this source code. | ||
| */ | ||
|
|
||
| namespace Swag\PlatformDemoData\helper; | ||
|
|
||
| use Shopware\Core\Framework\Log\Package; | ||
| use Shopware\Core\Framework\Uuid\Uuid; | ||
| use Swag\PlatformDemoData\DataProvider\CustomerProvider; | ||
|
|
||
| #[Package('fundamentals@after-sales')] | ||
| class ProductReviewHelper | ||
| { | ||
| /** | ||
| * @return array<int, array<string, mixed>> | ||
| */ | ||
| public function createReviews(string $salesChannelId, string $languageId): array | ||
| { | ||
| return [ | ||
| [ | ||
| 'id' => Uuid::randomHex(), | ||
| 'salesChannelId' => $salesChannelId, | ||
| 'customerId' => CustomerProvider::CUSTOMER_ID, | ||
| 'languageId' => $languageId, | ||
| 'title' => 'Very good', | ||
| 'content' => 'Excellent product! The quality is top notch, everything works perfectly and exceeds my expectations. I definitely recommend buying it.', | ||
| 'points' => 5.0, | ||
| 'status' => true, | ||
| ], | ||
| [ | ||
| 'id' => Uuid::randomHex(), | ||
DennisGarding marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 'salesChannelId' => $salesChannelId, | ||
| 'customerId' => CustomerProvider::CUSTOMER_ID, | ||
| 'languageId' => $languageId, | ||
| 'title' => 'Outstanding Quality', | ||
| 'content' => 'Top product! High-quality build, easy to use, and fast delivery. I would buy it again anytime', | ||
| 'points' => 5.0, | ||
| 'status' => true, | ||
| ], | ||
| [ | ||
| 'id' => Uuid::randomHex(), | ||
| 'salesChannelId' => $salesChannelId, | ||
| 'customerId' => CustomerProvider::CUSTOMER_ID, | ||
| 'languageId' => $languageId, | ||
| 'title' => 'Exceeded Expectations', | ||
| 'content' => 'Absolutely delighted. Exactly as described, even better than expected.', | ||
| 'points' => 5.0, | ||
| 'status' => true, | ||
| ], | ||
| [ | ||
| 'id' => Uuid::randomHex(), | ||
| 'salesChannelId' => $salesChannelId, | ||
| 'customerId' => CustomerProvider::CUSTOMER_ID, | ||
| 'languageId' => $languageId, | ||
| 'title' => 'Perfect Choice', | ||
| 'content' => 'Perfect! Exactly what I was looking for. Works flawlessly.', | ||
| 'points' => 5.0, | ||
| 'status' => true, | ||
| ], | ||
| [ | ||
| 'id' => Uuid::randomHex(), | ||
| 'salesChannelId' => $salesChannelId, | ||
| 'customerId' => CustomerProvider::CUSTOMER_ID, | ||
| 'languageId' => $languageId, | ||
| 'title' => 'Good', | ||
| 'content' => 'Very good product with minor flaws. Overall, I am satisfied; it offers good value for money.', | ||
| 'points' => 4.0, | ||
| 'status' => true, | ||
| ], | ||
| [ | ||
| 'id' => Uuid::randomHex(), | ||
| 'salesChannelId' => $salesChannelId, | ||
| 'customerId' => CustomerProvider::CUSTOMER_ID, | ||
| 'languageId' => $languageId, | ||
| 'title' => 'Very Solid Product', | ||
| 'content' => 'Overall a very good product. Minor flaws, but nothing serious.', | ||
| 'points' => 4.0, | ||
| 'status' => true, | ||
| ], | ||
| [ | ||
| 'id' => Uuid::randomHex(), | ||
| 'salesChannelId' => $salesChannelId, | ||
| 'customerId' => CustomerProvider::CUSTOMER_ID, | ||
| 'languageId' => $languageId, | ||
| 'title' => 'Great Value for Money', | ||
| 'content' => 'Solid product with good value for money. I would recommend it.', | ||
| 'points' => 4.0, | ||
| 'status' => true, | ||
| ], | ||
| [ | ||
| 'id' => Uuid::randomHex(), | ||
| 'salesChannelId' => $salesChannelId, | ||
| 'customerId' => CustomerProvider::CUSTOMER_ID, | ||
| 'languageId' => $languageId, | ||
| 'title' => 'Satisfactory', | ||
| 'content' => 'The product is fine, serves its purpose, but there is nothing special about it. Acceptable for the price.', | ||
| 'points' => 3.0, | ||
| 'status' => true, | ||
| ], | ||
| [ | ||
| 'id' => Uuid::randomHex(), | ||
| 'salesChannelId' => $salesChannelId, | ||
| 'customerId' => CustomerProvider::CUSTOMER_ID, | ||
| 'languageId' => $languageId, | ||
| 'title' => 'Does the Job', | ||
| 'content' => 'Okay for everyday use. Does its job, but there are definitely better alternatives.', | ||
| 'points' => 3.0, | ||
| 'status' => true, | ||
| ], | ||
| [ | ||
| 'id' => Uuid::randomHex(), | ||
| 'salesChannelId' => $salesChannelId, | ||
| 'customerId' => CustomerProvider::CUSTOMER_ID, | ||
| 'languageId' => $languageId, | ||
| 'title' => 'Average Experience', | ||
| 'content' => 'Average. Neither particularly good nor particularly bad.', | ||
| 'points' => 3.0, | ||
| 'status' => true, | ||
| ], | ||
| [ | ||
| 'id' => Uuid::randomHex(), | ||
| 'salesChannelId' => $salesChannelId, | ||
| 'customerId' => CustomerProvider::CUSTOMER_ID, | ||
| 'languageId' => $languageId, | ||
| 'title' => 'Poor', | ||
| 'content' => 'Unfortunately disappointing. The quality is mediocre and there were several problems during use.', | ||
| 'points' => 2.0, | ||
| 'status' => true, | ||
| ], | ||
| [ | ||
| 'id' => Uuid::randomHex(), | ||
| 'salesChannelId' => $salesChannelId, | ||
| 'customerId' => CustomerProvider::CUSTOMER_ID, | ||
| 'languageId' => $languageId, | ||
| 'title' => 'Disappointing Durability', | ||
| 'content' => 'Unfortunately not very durable. Problems appeared after a short time.', | ||
| 'points' => 2.0, | ||
| 'status' => true, | ||
| ], | ||
| [ | ||
| 'id' => Uuid::randomHex(), | ||
| 'salesChannelId' => $salesChannelId, | ||
| 'customerId' => CustomerProvider::CUSTOMER_ID, | ||
| 'languageId' => $languageId, | ||
| 'title' => 'Good Idea, Weak Execution', | ||
| 'content' => 'The idea is good, but the execution is lacking.', | ||
| 'points' => 2.0, | ||
| 'status' => true, | ||
| ], | ||
| [ | ||
| 'id' => Uuid::randomHex(), | ||
| 'salesChannelId' => $salesChannelId, | ||
| 'customerId' => CustomerProvider::CUSTOMER_ID, | ||
| 'languageId' => $languageId, | ||
| 'title' => 'Very poor', | ||
| 'content' => 'Absolutely not recommended. The product is defective, does not work as described and appears to be cheaply made.', | ||
| 'points' => 1.0, | ||
| 'status' => true, | ||
| ], | ||
| [ | ||
| 'id' => Uuid::randomHex(), | ||
| 'salesChannelId' => $salesChannelId, | ||
| 'customerId' => CustomerProvider::CUSTOMER_ID, | ||
| 'languageId' => $languageId, | ||
| 'title' => 'Not Worth It', | ||
| 'content' => 'Very disappointing. Poor quality and not functional upon delivery.', | ||
| 'points' => 1.0, | ||
| 'status' => true, | ||
| ], | ||
| ]; | ||
| } | ||
| } | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.