-
-
Notifications
You must be signed in to change notification settings - Fork 94
Link order generation to state machine #283
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: 1.0
Are you sure you want to change the base?
Changes from 2 commits
1b76e14
a817d69
380941a
7e36063
3ec77e8
f77bc23
3c3a1fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -35,16 +35,16 @@ public function __construct( | |||||||||
| ) { | ||||||||||
| } | ||||||||||
|
|
||||||||||
| public function __invoke(string $orderNumber, \DateTimeInterface $dateTime): void | ||||||||||
| public function __invoke(int $orderId, \DateTimeInterface $dateTime): void | ||||||||||
| { | ||||||||||
| /** @var OrderInterface $order */ | ||||||||||
| $order = $this->orderRepository->findOneByNumber($orderNumber); | ||||||||||
| $order = $this->orderRepository->find($orderId); | ||||||||||
|
||||||||||
| $order = $this->orderRepository->find($orderId); | |
| /** @var OrderInterface|null $order */ | |
| $order = $this->orderRepository->findOneBy(['number' => $orderNumber]); | |
| Assert::notNull($order, sprintf('Order with number "%s" does not exist.', $orderNumber)); |
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.
I tried this before but it didn't work, I'll try again.
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.
The Behat test is maybe missing something, in my current projet I have to prepare my order doing this :
$stateMachine = $this->stateMachineFactory->get($order, OrderTransitions::GRAPH);
$stateMachine->apply(OrderTransitions::TRANSITION_CREATE);save it to the database and complete the order (OrderCheckoutTransitions::TRANSITION_COMPLETE).
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,13 @@ winzou_state_machine: | |
| on: ['complete'] | ||
| do: ['@sylius_invoicing_plugin.event_producer.order_payment_paid', '__invoke'] | ||
| args: ['object'] | ||
| sylius_order: | ||
| callbacks: | ||
| after: | ||
| sylius_invoicing_plugin_order_placed_producer: | ||
| on: ['create'] | ||
| do: ['@sylius_invoicing_plugin.event_producer.order_placed', '__invoke'] | ||
| args: ['object'] | ||
|
||
|
|
||
| sylius_grid: | ||
| templates: | ||
|
|
||
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.
This phpdoc is missing the possibility of
null