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

PBC-1580: Integrates Merchant Events #205

Open
wants to merge 4 commits into
base: internal
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
35 changes: 20 additions & 15 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions config/Shared/config_default.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use Generated\Shared\Transfer\AssetAddedTransfer;
use Generated\Shared\Transfer\AssetDeletedTransfer;
use Generated\Shared\Transfer\AssetUpdatedTransfer;
use Generated\Shared\Transfer\ExportMerchantsTransfer;
use Generated\Shared\Transfer\InitializeProductExportTransfer;
use Generated\Shared\Transfer\OrderStatusChangedTransfer;
use Generated\Shared\Transfer\PaymentCancelReservationFailedTransfer;
Expand Down Expand Up @@ -750,6 +751,10 @@
OrderStatusChangedTransfer::class => 'order-events',
SearchEndpointAvailableTransfer::class => 'search-commands',
SearchEndpointRemovedTransfer::class => 'search-commands',
ExportMerchantsTransfer::class => 'merchant-commands',
MerchantExportedTransfer::class => 'merchant-events',
MerchantCreatedTransfer::class => 'merchant-events',
MerchantUpdatedTransfer::class => 'merchant-events',
];

$config[MessageBrokerConstants::CHANNEL_TO_TRANSPORT_MAP] = [
Expand All @@ -760,8 +765,10 @@
'asset-commands' => MessageBrokerAwsConfig::SQS_TRANSPORT,
'product-commands' => MessageBrokerAwsConfig::SQS_TRANSPORT,
'search-commands' => MessageBrokerAwsConfig::SQS_TRANSPORT,
'merchant-commands' => MessageBrokerAwsConfig::SQS_TRANSPORT,
'order-events' => 'http',
'product-events' => 'http',
'merchant-events' => 'http',
matweew marked this conversation as resolved.
Show resolved Hide resolved
];

$config[MessageBrokerAwsConstants::CHANNEL_TO_RECEIVER_TRANSPORT_MAP] = [
Expand All @@ -773,12 +780,14 @@
'product-commands' => MessageBrokerAwsConfig::SQS_TRANSPORT,
'search-commands' => MessageBrokerAwsConfig::SQS_TRANSPORT,
'order-events' => MessageBrokerAwsConfig::SQS_TRANSPORT,
'merchant-commands' => MessageBrokerAwsConfig::SQS_TRANSPORT,
];

$config[MessageBrokerAwsConstants::CHANNEL_TO_SENDER_TRANSPORT_MAP] = [
'payment-commands' => 'http',
'product-events' => 'http',
'order-events' => 'http',
'merchant-events' => 'http',
];

$aopInfrastructureConfiguration = json_decode(html_entity_decode((string)getenv('SPRYKER_AOP_INFRASTRUCTURE')), true);
Expand Down
1 change: 1 addition & 0 deletions src/Pyz/Zed/MessageBroker/MessageBrokerConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function getDefaultWorkerChannels(): array
'asset-commands',
'product-commands',
'search-commands',
'merchant-commands',
];
}

Expand Down
2 changes: 2 additions & 0 deletions src/Pyz/Zed/MessageBroker/MessageBrokerDependencyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Spryker\Zed\Asset\Communication\Plugin\MessageBroker\AssetAddedMessageHandlerPlugin;
use Spryker\Zed\Asset\Communication\Plugin\MessageBroker\AssetDeletedMessageHandlerPlugin;
use Spryker\Zed\Asset\Communication\Plugin\MessageBroker\AssetUpdatedMessageHandlerPlugin;
use Spryker\Zed\Merchant\Communication\Plugin\MessageBroker\MerchantExportMerchantsMessageHandlerPlugin;
use Spryker\Zed\MessageBroker\Communication\Plugin\MessageBroker\CorrelationIdMessageAttributeProviderPlugin;
use Spryker\Zed\MessageBroker\Communication\Plugin\MessageBroker\TimestampMessageAttributeProviderPlugin;
use Spryker\Zed\MessageBroker\Communication\Plugin\MessageBroker\TransactionIdMessageAttributeProviderPlugin;
Expand Down Expand Up @@ -85,6 +86,7 @@ public function getMessageHandlerPlugins(): array
new SearchEndpointAvailableMessageHandlerPlugin(),
new SearchEndpointRemovedMessageHandlerPlugin(),
new ProductReviewAddReviewsMessageHandlerPlugin(),
new MerchantExportMerchantsMessageHandlerPlugin(),
];
}

Expand Down
16 changes: 16 additions & 0 deletions src/Pyz/Zed/Publisher/PublisherDependencyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
use Spryker\Zed\GlossaryStorage\Communication\Plugin\Publisher\GlossaryKey\GlossaryWritePublisherPlugin as GlossaryKeyWriterPublisherPlugin;
use Spryker\Zed\GlossaryStorage\Communication\Plugin\Publisher\GlossaryPublisherTriggerPlugin;
use Spryker\Zed\GlossaryStorage\Communication\Plugin\Publisher\GlossaryTranslation\GlossaryWritePublisherPlugin as GlossaryTranslationWritePublisherPlugin;
use Spryker\Zed\Merchant\Communication\Plugin\Publisher\MerchantCreatedMessageBrokerPublisherPlugin;
use Spryker\Zed\Merchant\Communication\Plugin\Publisher\MerchantExportedMessageBrokerPublisherPlugin;
use Spryker\Zed\Merchant\Communication\Plugin\Publisher\MerchantUpdatedMessageBrokerPublisherPlugin;
use Spryker\Zed\PriceProductMerchantRelationshipStorage\Communication\Plugin\Publisher\Merchant\MerchantWritePublisherPlugin;
use Spryker\Zed\Product\Communication\Plugin\Publisher\ProductAbstractUpdatedMessageBrokerPublisherPlugin;
use Spryker\Zed\Product\Communication\Plugin\Publisher\ProductConcreteCreatedMessageBrokerPublisherPlugin;
Expand Down Expand Up @@ -135,6 +138,7 @@ protected function getPublisherPlugins(): array
$this->getProductBundleStoragePlugins(),
$this->getProductConfigurationStoragePlugins(),
$this->getProductExportPlugins(),
$this->getMerchantExportPlugins(),
);
}

Expand Down Expand Up @@ -401,4 +405,16 @@ protected function getProductExportPlugins(): array
new ProductAbstractUpdatedMessageBrokerPublisherPlugin(),
];
}

/**
* @return array<\Spryker\Zed\PublisherExtension\Dependency\Plugin\PublisherPluginInterface>
*/
protected function getMerchantExportPlugins(): array
{
return [
new MerchantExportedMessageBrokerPublisherPlugin(),
new MerchantCreatedMessageBrokerPublisherPlugin(),
new MerchantUpdatedMessageBrokerPublisherPlugin(),
];
}
}