Skip to content
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

bus-unification #288

Merged
merged 5 commits into from
May 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### UPGRADE FROM 1.0.0-RC.9 TO 1.0.0-RC.10

Command bus `sylius_refund_plugin.command_bus` has been replaced with `sylius.command_bus`.
Event bus `sylius_refund_plugin.event_bus` has been replaced with `sylius.event_bus`.

### UPGRADE FROM 1.0.0-RC.7 TO 1.0.0-RC.8

1. The `fully_refunded` state and the `refund` transition have been removed from `sylius_order` state machine.
Expand Down
7 changes: 5 additions & 2 deletions src/Resources/config/app/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ sylius_mailer:
framework:
messenger:
buses:
sylius_refund_plugin.command_bus: ~
sylius_refund_plugin.event_bus:
sylius.command_bus:
middleware:
- 'validation'
- 'doctrine_transaction'
sylius.event_bus:
default_middleware: allow_no_handlers

winzou_state_machine:
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@

<service id="Sylius\RefundPlugin\Refunder\OrderItemUnitsRefunder">
<argument type="service" id="Sylius\RefundPlugin\Creator\RefundCreator" />
<argument type="service" id="sylius_refund_plugin.event_bus" />
<argument type="service" id="sylius.event_bus" />
</service>
<service id="Sylius\RefundPlugin\Refunder\OrderShipmentsRefunder">
<argument type="service" id="Sylius\RefundPlugin\Creator\RefundCreator" />
<argument type="service" id="sylius_refund_plugin.event_bus" />
<argument type="service" id="sylius.event_bus" />
</service>

<service id="Sylius\RefundPlugin\Factory\CreditMemoSequenceFactory" />
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/config/services/actions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</service>

<service id="Sylius\RefundPlugin\Action\Admin\RefundUnitsAction">
<argument type="service" id="sylius_refund_plugin.command_bus" />
<argument type="service" id="sylius.command_bus" />
<argument type="service" id="session" />
<argument type="service" id="router" />
<argument type="service" id="Sylius\RefundPlugin\Creator\RefundUnitsCommandCreator" />
Expand All @@ -41,7 +41,7 @@
</service>

<service id="Sylius\RefundPlugin\Action\Admin\SendCreditMemoAction">
<argument type="service" id="sylius_refund_plugin.command_bus"/>
<argument type="service" id="sylius.command_bus"/>
<argument type="service" id="sylius_refund.repository.credit_memo"/>
<argument type="service" id="session"/>
<argument type="service" id="router"/>
Expand Down
8 changes: 4 additions & 4 deletions src/Resources/config/services/command_bus.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
<service id="Sylius\RefundPlugin\CommandHandler\RefundUnitsHandler">
<argument type="service" id="Sylius\RefundPlugin\Refunder\OrderItemUnitsRefunder" />
<argument type="service" id="Sylius\RefundPlugin\Refunder\OrderShipmentsRefunder" />
<argument type="service" id="sylius_refund_plugin.event_bus" />
<argument type="service" id="sylius.event_bus" />
<argument type="service" id="sylius.repository.order" />
<argument type="service" id="Sylius\RefundPlugin\Validator\RefundUnitsCommandValidator" />
<tag name="messenger.message_handler" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
</service>

<service id="Sylius\RefundPlugin\CommandHandler\GenerateCreditMemoHandler">
<argument type="service" id="Sylius\RefundPlugin\Generator\CreditMemoGenerator" />
<argument type="service" id="sylius_refund.manager.credit_memo" />
<argument type="service" id="sylius_refund_plugin.event_bus" />
<argument type="service" id="sylius.event_bus" />
<argument type="service" id="sylius.repository.order" />
<tag name="messenger.message_handler" />
<tag name="messenger.message_handler"/>
</service>

<service id="Sylius\RefundPlugin\CommandHandler\SendCreditMemoHandler" >
Expand Down
16 changes: 8 additions & 8 deletions src/Resources/config/services/event_bus.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@
<defaults autowire="false" autoconfigure="false" public="true" />

<service id="Sylius\RefundPlugin\Listener\CreditMemoGeneratedEventListener">
<argument type="service" id="sylius_refund_plugin.event_bus" />
<tag name="messenger.message_handler" />
<argument type="service" id="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius.event_bus" />
</service>

<service id="Sylius\RefundPlugin\Listener\UnitRefundedEventListener">
<argument type="service" id="Sylius\RefundPlugin\StateResolver\OrderPartiallyRefundedStateResolver" />
<tag name="messenger.message_handler" />
<tag name="messenger.message_handler" bus="sylius.event_bus" />
</service>

<service id="Sylius\RefundPlugin\Listener\ShipmentRefundedEventListener">
<argument type="service" id="Sylius\RefundPlugin\StateResolver\OrderPartiallyRefundedStateResolver" />
<tag name="messenger.message_handler" />
<tag name="messenger.message_handler" bus="sylius.event_bus" />
</service>

<service id="Sylius\RefundPlugin\ProcessManager\CreditMemoProcessManager">
<argument type="service" id="sylius_refund_plugin.command_bus" />
<tag name="messenger.message_handler" />
<argument type="service" id="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius.event_bus" />
</service>

<service id="Sylius\RefundPlugin\ProcessManager\RefundPaymentProcessManager">
<argument type="service" id="Sylius\RefundPlugin\StateResolver\OrderFullyRefundedStateResolver" />
<argument type="service" id="Sylius\RefundPlugin\Provider\RelatedPaymentIdProviderInterface" />
<argument type="service" id="Sylius\RefundPlugin\Factory\RefundPaymentFactory" />
<argument type="service" id="doctrine.orm.default_entity_manager" />
<argument type="service" id="sylius_refund_plugin.event_bus" />
<tag name="messenger.message_handler" />
<argument type="service" id="sylius.event_bus" />
<tag name="messenger.message_handler" bus="sylius.event_bus" />
</service>
</services>
</container>
4 changes: 2 additions & 2 deletions tests/Behat/Resources/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<argument type="service" id="sylius.repository.order" />
<argument type="service" id="sylius_refund.repository.refund" />
<argument type="service" id="Sylius\RefundPlugin\Provider\RemainingTotalProvider" />
<argument type="service" id="sylius_refund_plugin.command_bus" />
<argument type="service" id="sylius.command_bus" />
<argument type="service" id="sylius.behat.email_checker" />
</service>

Expand Down Expand Up @@ -63,7 +63,7 @@

<service id="Tests\Sylius\RefundPlugin\Behat\Context\Setup\RefundingContext">
<argument type="service" id="sylius.repository.order" />
<argument type="service" id="sylius_refund_plugin.command_bus" />
<argument type="service" id="sylius.command_bus" />
</service>

<service id="Tests\Sylius\RefundPlugin\Behat\Context\Setup\OrderContext">
Expand Down