Skip to content
Open
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 CHANGELOG-3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CHANGELOG

### v3.0.0 (2025-10-22)

- [#397](https://github.com/Sylius/InvoicingPlugin/pull/397) Isolate plugin messaging: Introduce dedicated event & command buses for InvoicingPlugin ([@tomkalon](https://github.com/tomkalon))
21 changes: 21 additions & 0 deletions UPGRADE-3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# UPGRADE FROM 2.1 TO 3.0

## Changes

1. Introduced plugin-specific Messenger buses (`sylius_invoicing.command_bus` and `sylius_invoicing.event_bus`):

- The Invoicing Plugin no longer uses the global `sylius.command_bus` or `sylius.event_bus`.
- If you have custom message handlers, middleware, or routing related to the plugin, update them to use the new plugin-specific buses.
- Example configuration:

```yaml
framework:
messenger:
buses:
sylius_invoicing.command_bus:
middleware:
- 'validation'
- 'doctrine_transaction'
sylius_invoicing.event_bus:
default_middleware: allow_no_handlers
```
4 changes: 2 additions & 2 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ sylius_grid:
framework:
messenger:
buses:
sylius.event_bus:
sylius_invoicing.event_bus:
default_middleware: allow_no_handlers
sylius.command_bus:
sylius_invoicing.command_bus:
middleware:
- 'validation'
- 'doctrine_transaction'
Expand Down
2 changes: 1 addition & 1 deletion config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<argument type="service" id="sylius_invoicing.repository.invoice" />
<argument type="service" id="sylius.repository.order" />
<argument type="service" id="sylius_invoicing.email.invoice_email_sender" />
<tag name="messenger.message_handler" />
<tag name="messenger.message_handler" bus="sylius_invoicing.command_bus"/>
</service>

<service id="sylius_invoicing.security.voter.invoice" class="Sylius\InvoicingPlugin\Security\Voter\InvoiceVoter">
Expand Down
10 changes: 5 additions & 5 deletions config/services/listeners.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,26 @@
<defaults public="true" />

<service id="sylius_invoicing.event_producer.order_payment_paid" class="Sylius\InvoicingPlugin\EventProducer\OrderPaymentPaidProducer">
<argument type="service" id="sylius.event_bus" />
<argument type="service" id="sylius_invoicing.event_bus" />
<argument type="service" id="clock" />
<argument type="service" id="sylius_invoicing.repository.invoice" />
</service>

<service id="sylius_invoicing.listener.order_placed" class="Sylius\InvoicingPlugin\EventListener\CreateInvoiceOnOrderPlacedListener">
<argument type="service" id="sylius_invoicing.creator.invoice" />
<tag name="messenger.message_handler" bus="sylius.event_bus" />
<tag name="messenger.message_handler" bus="sylius_invoicing.event_bus" />
</service>

<service id="sylius_invoicing.event_producer.order_placed" class="Sylius\InvoicingPlugin\EventProducer\OrderPlacedProducer">
<argument type="service" id="sylius.event_bus" />
<argument type="service" id="sylius_invoicing.event_bus" />
<argument type="service" id="clock" />
<tag name="doctrine.event_listener" event="postPersist" />
<tag name="doctrine.event_listener" event="postUpdate" />
</service>

<service id="sylius_invoicing.listener.order_payment_paid" class="Sylius\InvoicingPlugin\EventListener\OrderPaymentPaidListener">
<argument type="service" id="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius.event_bus" />
<argument type="service" id="sylius_invoicing.command_bus" />
<tag name="messenger.message_handler" bus="sylius_invoicing.event_bus" />
</service>
</services>
</container>