Skip to content

Commit

Permalink
Merge pull request #5 from Setono/service-ids
Browse files Browse the repository at this point in the history
Change service ids to fqcns
  • Loading branch information
loevgaard authored Jun 28, 2024
2 parents 03a28bb + 63046d9 commit 03048d7
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 64 deletions.
4 changes: 2 additions & 2 deletions src/Resources/config/routes/admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ setono_sylius_peak_admin_peak_index:
path: /peak
methods: [GET,POST]
defaults:
_controller: setono_sylius_peak.controller.admin.peak::index
_controller: Setono\SyliusPeakPlugin\Controller\Admin\PeakController::index

setono_sylius_peak_admin_peak_register_webhooks:
path: /peak/register-webhooks
methods: [GET]
defaults:
_controller: setono_sylius_peak.controller.admin.peak::registerWebhooks
_controller: Setono\SyliusPeakPlugin\Controller\Admin\PeakController::registerWebhooks
2 changes: 1 addition & 1 deletion src/Resources/config/routes/global.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
setono_sylius_peak_global_webhook:
path: /peak/webhook
defaults:
_controller: setono_sylius_peak.controller.handle_webhook
_controller: Setono\SyliusPeakPlugin\Controller\HandleWebhookControllerAction
4 changes: 2 additions & 2 deletions src/Resources/config/services/client.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="Setono\PeakWMS\Client\ClientInterface" alias="setono_sylius_peak.client"/>
<service id="Setono\PeakWMS\Client\ClientInterface" alias="Setono\PeakWMS\Client\Client"/>

<service id="setono_sylius_peak.client" class="Setono\PeakWMS\Client\Client">
<service id="Setono\PeakWMS\Client\Client">
<argument>%setono_sylius_peak.api_key%</argument>

<call method="setLogger">
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/config/services/command.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="Setono\SyliusPeakPlugin\Command\ProcessCommand">
<argument type="service" id="setono_sylius_peak.processor.upload_order_request"/>
<argument type="service" id="Setono\SyliusPeakPlugin\Processor\UploadOrderRequestProcessorInterface"/>

<tag name="console.command"/>
</service>
Expand Down
14 changes: 6 additions & 8 deletions src/Resources/config/services/controller.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="setono_sylius_peak.controller.admin.peak"
class="Setono\SyliusPeakPlugin\Controller\Admin\PeakController" public="true">
<service id="Setono\SyliusPeakPlugin\Controller\Admin\PeakController" public="true">
<argument type="service" id="setono_sylius_peak.command_bus"/>
<argument type="service" id="setono_sylius_peak.registrar.webhook"/>
<argument type="service" id="setono_sylius_peak.client"/>
<argument type="service" id="Setono\SyliusPeakPlugin\Registrar\WebhookRegistrarInterface"/>
<argument type="service" id="Setono\PeakWMS\Client\ClientInterface"/>

<call method="setContainer">
<argument type="service" id="service_container"/>
Expand All @@ -15,10 +14,9 @@
<tag name="controller.service_arguments"/>
</service>

<service id="setono_sylius_peak.controller.handle_webhook"
class="Setono\SyliusPeakPlugin\Controller\HandleWebhookControllerAction" public="true">
<argument type="service" id="setono_sylius_peak.webhook_parser"/>
<argument type="service" id="setono_sylius_peak.webhook_handler.composite"/>
<service id="Setono\SyliusPeakPlugin\Controller\HandleWebhookControllerAction" public="true">
<argument type="service" id="Setono\PeakWMS\Parser\WebhookParserInterface"/>
<argument type="service" id="Setono\SyliusPeakPlugin\WebhookHandler\WebhookHandlerInterface"/>
</service>
</services>
</container>
15 changes: 7 additions & 8 deletions src/Resources/config/services/data_mapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="setono_sylius_peak.data_mapper.sales_order.composite"
class="Setono\SyliusPeakPlugin\DataMapper\CompositeSalesOrderDataMapper">
<service id="Setono\SyliusPeakPlugin\DataMapper\SalesOrderDataMapperInterface"
alias="Setono\SyliusPeakPlugin\DataMapper\CompositeSalesOrderDataMapper"/>

<service id="Setono\SyliusPeakPlugin\DataMapper\CompositeSalesOrderDataMapper">
<argument type="service" id="event_dispatcher"/>
</service>

<service id="setono_sylius_peak.data_mapper.sales_order.default"
class="Setono\SyliusPeakPlugin\DataMapper\SalesOrderDataMapper">
<service id="Setono\SyliusPeakPlugin\DataMapper\SalesOrderDataMapper">
<tag name="setono_sylius_peak.sales_order_data_mapper" priority="100"/>
</service>

<service id="setono_sylius_peak.data_mapper.sales_order.order_lines"
class="Setono\SyliusPeakPlugin\DataMapper\SalesOrderLinesSalesOrderDataMapper">
<service id="Setono\SyliusPeakPlugin\DataMapper\SalesOrderLinesSalesOrderDataMapper">
<argument type="service" id="event_dispatcher"/>

<tag name="setono_sylius_peak.sales_order_data_mapper" priority="90"/>
</service>

<service id="setono_sylius_peak.data_mapper.sales_order.shipping_cost"
class="Setono\SyliusPeakPlugin\DataMapper\ShippingCostSalesOrderDataMapper">
<service id="Setono\SyliusPeakPlugin\DataMapper\ShippingCostSalesOrderDataMapper">
<tag name="setono_sylius_peak.sales_order_data_mapper" priority="80"/>
</service>
</services>
Expand Down
12 changes: 4 additions & 8 deletions src/Resources/config/services/event_subscriber.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,21 @@
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="setono_sylius_peak.event_subscriber.grid.add_upload_order_request_column_to_order_grid"
class="Setono\SyliusPeakPlugin\EventSubscriber\Grid\AddUploadOrderRequestColumnToOrderGridSubscriber">
<service id="Setono\SyliusPeakPlugin\EventSubscriber\Grid\AddUploadOrderRequestColumnToOrderGridSubscriber">
<tag name="kernel.event_subscriber"/>
</service>

<service id="setono_sylius_peak.event_subscriber.add_link_to_peak"
class="Setono\SyliusPeakPlugin\EventSubscriber\AddLinkToPeakSubscriber">
<service id="Setono\SyliusPeakPlugin\EventSubscriber\AddLinkToPeakSubscriber">
<argument>%kernel.debug%</argument>

<tag name="kernel.event_subscriber"/>
</service>

<service id="setono_sylius_peak.event_subscriber.add_menu"
class="Setono\SyliusPeakPlugin\EventSubscriber\AddMenuSubscriber">
<service id="Setono\SyliusPeakPlugin\EventSubscriber\AddMenuSubscriber">
<tag name="kernel.event_subscriber"/>
</service>

<service id="setono_sylius_peak.event_subscriber.create_upload_order_request"
class="Setono\SyliusPeakPlugin\EventSubscriber\CreateUploadOrderRequestSubscriber">
<service id="Setono\SyliusPeakPlugin\EventSubscriber\CreateUploadOrderRequestSubscriber">
<argument type="service" id="doctrine"/>
<argument type="service" id="setono_sylius_peak.factory.upload_order_request"/>

Expand Down
10 changes: 4 additions & 6 deletions src/Resources/config/services/factory.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="setono_sylius_peak.custom_factory.registered_webhooks"
class="Setono\SyliusPeakPlugin\Factory\RegisteredWebhooksFactory"
<service id="Setono\SyliusPeakPlugin\Factory\RegisteredWebhooksFactory"
decorates="setono_sylius_peak.factory.registered_webhooks" decoration-priority="64">
<argument type="service" id="setono_sylius_peak.custom_factory.registered_webhooks.inner"/>
<argument type="service" id="Setono\SyliusPeakPlugin\Factory\RegisteredWebhooksFactory.inner"/>
</service>

<service id="setono_sylius_peak.custom_factory.upload_order_request"
class="Setono\SyliusPeakPlugin\Factory\UploadOrderRequestFactory"
<service id="Setono\SyliusPeakPlugin\Factory\UploadOrderRequestFactory"
decorates="setono_sylius_peak.factory.upload_order_request" decoration-priority="64">
<argument type="service" id="setono_sylius_peak.custom_factory.upload_order_request.inner"/>
<argument type="service" id="Setono\SyliusPeakPlugin\Factory\UploadOrderRequestFactory.inner"/>
</service>
</services>
</container>
12 changes: 5 additions & 7 deletions src/Resources/config/services/message.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="setono_sylius_peak.message.command_handler.process_upload_order_request"
class="Setono\SyliusPeakPlugin\Message\CommandHandler\ProcessUploadOrderRequestHandler">
<service id="Setono\SyliusPeakPlugin\Message\CommandHandler\ProcessUploadOrderRequestHandler">
<argument type="service" id="doctrine"/>
<argument type="service" id="setono_sylius_peak.client"/>
<argument type="service" id="setono_sylius_peak.data_mapper.sales_order.composite"/>
<argument type="service" id="Setono\PeakWMS\Client\ClientInterface"/>
<argument type="service" id="Setono\SyliusPeakPlugin\DataMapper\SalesOrderDataMapperInterface"/>
<argument type="service" id="state_machine.setono_sylius_peak__upload_order_request"/>
<argument>%setono_sylius_peak.model.upload_order_request.class%</argument>

<tag name="messenger.message_handler"/>
</service>

<service id="setono_sylius_peak.message.command_handler.register_webhooks"
class="Setono\SyliusPeakPlugin\Message\CommandHandler\RegisterWebhooksHandler">
<argument type="service" id="setono_sylius_peak.registrar.webhook"/>
<service id="Setono\SyliusPeakPlugin\Message\CommandHandler\RegisterWebhooksHandler">
<argument type="service" id="Setono\SyliusPeakPlugin\Registrar\WebhookRegistrarInterface"/>

<tag name="messenger.message_handler"/>
</service>
Expand Down
5 changes: 3 additions & 2 deletions src/Resources/config/services/parser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="setono_sylius_peak.webhook_parser"
class="Setono\PeakWMS\Parser\WebhookParser"/>
<service id="Setono\PeakWMS\Parser\WebhookParserInterface" alias="Setono\PeakWMS\Parser\WebhookParser"/>

<service id="Setono\PeakWMS\Parser\WebhookParser"/>
</services>
</container>
8 changes: 5 additions & 3 deletions src/Resources/config/services/processor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="setono_sylius_peak.processor.upload_order_request"
class="Setono\SyliusPeakPlugin\Processor\UploadOrderRequestProcessor">
<argument type="service" id="setono_sylius_peak.provider.pre_qualified_upload_order_requests"/>
<service id="Setono\SyliusPeakPlugin\Processor\UploadOrderRequestProcessorInterface"
alias="Setono\SyliusPeakPlugin\Processor\UploadOrderRequestProcessor"/>

<service id="Setono\SyliusPeakPlugin\Processor\UploadOrderRequestProcessor">
<argument type="service" id="Setono\SyliusPeakPlugin\Provider\PreQualifiedUploadOrderRequestsProviderInterface"/>
<argument type="service" id="setono_sylius_peak.command_bus"/>
<argument type="service" id="state_machine.setono_sylius_peak__upload_order_request"/>
<argument type="service" id="doctrine"/>
Expand Down
12 changes: 8 additions & 4 deletions src/Resources/config/services/provider.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="setono_sylius_peak.provider.pre_qualified_upload_order_requests"
class="Setono\SyliusPeakPlugin\Provider\PreQualifiedUploadOrderRequestsProvider">
<service id="Setono\SyliusPeakPlugin\Provider\PreQualifiedUploadOrderRequestsProviderInterface"
alias="Setono\SyliusPeakPlugin\Provider\PreQualifiedUploadOrderRequestsProvider"/>

<service id="Setono\SyliusPeakPlugin\Provider\PreQualifiedUploadOrderRequestsProvider">
<argument type="service" id="doctrine"/>
<argument type="service" id="event_dispatcher"/>
<argument>%setono_sylius_peak.model.upload_order_request.class%</argument>
</service>

<service id="setono_sylius_peak.provider.product_variant"
class="Setono\SyliusPeakPlugin\Provider\ProductVariantProvider">
<service id="Setono\SyliusPeakPlugin\Provider\ProductVariantProviderInterface"
alias="Setono\SyliusPeakPlugin\Provider\ProductVariantProvider"/>

<service id="Setono\SyliusPeakPlugin\Provider\ProductVariantProvider">
<argument type="service" id="doctrine"/>
<argument>%sylius.model.product_variant.class%</argument>
</service>
Expand Down
8 changes: 5 additions & 3 deletions src/Resources/config/services/registrar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="setono_sylius_peak.registrar.webhook"
class="Setono\SyliusPeakPlugin\Registrar\WebhookRegistrar">
<argument type="service" id="setono_sylius_peak.client"/>
<service id="Setono\SyliusPeakPlugin\Registrar\WebhookRegistrarInterface"
alias="Setono\SyliusPeakPlugin\Registrar\WebhookRegistrar"/>

<service id="Setono\SyliusPeakPlugin\Registrar\WebhookRegistrar">
<argument type="service" id="Setono\PeakWMS\Client\ClientInterface"/>
<argument type="service" id="router"/>
<argument type="service" id="setono_sylius_peak.repository.registered_webhooks"/>
<argument type="service" id="setono_sylius_peak.factory.registered_webhooks"/>
Expand Down
14 changes: 7 additions & 7 deletions src/Resources/config/services/webhook_handler.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="setono_sylius_peak.webhook_handler.composite"
class="Setono\SyliusPeakPlugin\WebhookHandler\CompositeWebhookHandler"/>
<service id="Setono\SyliusPeakPlugin\WebhookHandler\WebhookHandlerInterface"
alias="Setono\SyliusPeakPlugin\WebhookHandler\CompositeWebhookHandler"/>

<service id="setono_sylius_peak.webhook_handler.order_packed"
class="Setono\SyliusPeakPlugin\WebhookHandler\OrderPackedWebhookHandler">
<service id="Setono\SyliusPeakPlugin\WebhookHandler\CompositeWebhookHandler"/>

<service id="Setono\SyliusPeakPlugin\WebhookHandler\OrderPackedWebhookHandler">
<argument type="service" id="sylius.repository.order"/>
<argument type="service" id="sm.factory"/>

<tag name="setono_sylius_peak.webhook_handler"/>
</service>

<service id="setono_sylius_peak.webhook_handler.stock_adjustment"
class="Setono\SyliusPeakPlugin\WebhookHandler\StockAdjustmentWebhookHandler">
<argument type="service" id="setono_sylius_peak.provider.product_variant"/>
<service id="Setono\SyliusPeakPlugin\WebhookHandler\StockAdjustmentWebhookHandler">
<argument type="service" id="Setono\SyliusPeakPlugin\Provider\ProductVariantProviderInterface"/>
<argument type="service" id="setono_sylius_peak.command_bus"/>

<tag name="setono_sylius_peak.webhook_handler"/>
Expand Down
6 changes: 4 additions & 2 deletions src/SetonoSyliusPeakPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
namespace Setono\SyliusPeakPlugin;

use Setono\CompositeCompilerPass\CompositeCompilerPass;
use Setono\SyliusPeakPlugin\DataMapper\CompositeSalesOrderDataMapper;
use Setono\SyliusPeakPlugin\WebhookHandler\CompositeWebhookHandler;
use Sylius\Bundle\CoreBundle\Application\SyliusPluginTrait;
use Sylius\Bundle\ResourceBundle\AbstractResourceBundle;
use Sylius\Bundle\ResourceBundle\SyliusResourceBundle;
Expand All @@ -20,12 +22,12 @@ public function build(ContainerBuilder $container): void
parent::build($container);

$container->addCompilerPass(new CompositeCompilerPass(
'setono_sylius_peak.data_mapper.sales_order.composite',
CompositeSalesOrderDataMapper::class,
'setono_sylius_peak.sales_order_data_mapper',
));

$container->addCompilerPass(new CompositeCompilerPass(
'setono_sylius_peak.webhook_handler.composite',
CompositeWebhookHandler::class,
'setono_sylius_peak.webhook_handler',
));
}
Expand Down

0 comments on commit 03048d7

Please sign in to comment.