-
-
Notifications
You must be signed in to change notification settings - Fork 1
Add reviews #4
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
base: master
Are you sure you want to change the base?
Add reviews #4
Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
d550511 to
f4b561c
Compare
| { | ||
| public function check(OrderInterface $order): ReviewableOrderCheck | ||
| { | ||
| if ($order->getState() === OrderInterface::STATE_FULFILLED) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add an array of 'reviewable states' in the contructor and make those configurable in the plugin configuration
| { | ||
| public function __construct( | ||
| private readonly StoreReviewRepositoryInterface $storeReviewRepository, | ||
| private readonly string $editablePeriod = '+24 hours', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this configurable in the plugin configuration. Also make it possible to disable this functionality because some store owners might want to allow users to be able to edit forever
| use Setono\SyliusReviewPlugin\Model\StoreReviewInterface; | ||
| use Sylius\Component\Review\Model\ReviewInterface; | ||
|
|
||
| final class ReviewAutoApprovalChecker implements ReviewAutoApprovalCheckerInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to AutoApprovalCheckerInterface and make it use the composite pattern used elsewhere in this plugin to allow plugin users to define their own 'auto approval checker' functionality
| use Setono\SyliusReviewPlugin\Workflow\StoreReviewWorkflow; | ||
| use Symfony\Component\Workflow\WorkflowInterface; | ||
|
|
||
| #[AsDoctrineListener(event: 'prePersist')] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this and use xml configuration instead
| ) { | ||
| } | ||
|
|
||
| public function prePersist(PrePersistEventArgs $args): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to do the same on preUpdate
8474c91 to
c329b4b
Compare
| <field name="createdAt" column="created_at" type="datetime"/> | ||
| <field name="updatedAt" column="updated_at" type="datetime" nullable="true"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use gedmo doctrine extensions for these properties
| <field name="createdAt" column="created_at" type="datetime"/> | ||
| <field name="updatedAt" column="updated_at" type="datetime" nullable="true"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use gedmo doctrine extensions for these properties
0e0be5f to
3b99cb6
Compare
No description provided.