Skip to content

Commit

Permalink
bus-unification
Browse files Browse the repository at this point in the history
  • Loading branch information
SirDomin committed May 10, 2021
1 parent 1d0af81 commit 912afe9
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 21 deletions.
3 changes: 1 addition & 2 deletions src/Resources/config/app/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ sylius_mailer:
framework:
messenger:
buses:
sylius_refund_plugin.command_bus: ~
sylius_refund_plugin.event_bus:
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_default.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_default.bus"/>
<argument type="service" id="sylius_refund.repository.credit_memo"/>
<argument type="service" id="session"/>
<argument type="service" id="router"/>
Expand Down
10 changes: 5 additions & 5 deletions src/Resources/config/services/command_bus.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@
<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_default.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_default.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_default.bus" />
<argument type="service" id="sylius.repository.order" />
<tag name="messenger.message_handler" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>

<service id="Sylius\RefundPlugin\CommandHandler\SendCreditMemoHandler" >
<argument type="service" id="sylius_refund.repository.credit_memo"/>
<argument type="service" id="Sylius\RefundPlugin\Sender\CreditMemoEmailSender"/>
<tag name="messenger.message_handler" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
</services>
</container>
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_default.bus" />
<tag name="messenger.message_handler" bus="sylius_default.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_default.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_default.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_default.bus" />
<tag name="messenger.message_handler" bus="sylius_default.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_default.bus" />
<tag name="messenger.message_handler" bus="sylius_default.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_default.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_default.bus" />
</service>

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

0 comments on commit 912afe9

Please sign in to comment.