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

Auto-updating Spryker modules on 2023-12-07 10:46 for release group #5164 / Jira ticket PBC-3553 #403

Merged
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
"spryker/stores-api": "^1.0.0",
"spryker/stores-backend-api": "^1.0.0",
"spryker/stores-rest-api": "^1.2.0",
"spryker/tax-app": "^0.2.0",
"spryker/tax-app": "^0.3.1",
"spryker/tax-product-connector": "^4.7.1",
"spryker/up-selling-products-rest-api": "^1.2.2",
"spryker/urls-rest-api": "^1.0.2",
Expand Down
49 changes: 25 additions & 24 deletions composer.lock

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

1 change: 1 addition & 0 deletions config/Shared/config_default.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@
= $config[OauthClientConstants::TENANT_IDENTIFIER]
= $config[PaymentConstants::TENANT_IDENTIFIER]
= $config[AppCatalogGuiConstants::TENANT_IDENTIFIER]
= $config[TaxAppConstants::TENANT_IDENTIFIER]
= getenv('SPRYKER_TENANT_IDENTIFIER') ?: '';

$config[MessageBrokerConstants::MESSAGE_TO_CHANNEL_MAP] =
Expand Down
10 changes: 1 addition & 9 deletions config/Zed/oms/DummyPayment01.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
<state name="waiting" reserved="true" display="oms.state.waiting"/>
<state name="exported" reserved="true" display="oms.state.exported"/>
<state name="product review requested" reserved="true" display="oms.state.paid"/>
<state name="confirmed" reserved="true" display="oms.state.confirmed">
<flag>cancellable</flag>
</state>
<state name="confirmed" reserved="true" display="oms.state.confirmed"/>
<state name="shipped" reserved="true" display="oms.state.shipped"/>
<state name="delivered" display="oms.state.delivered"/>
<state name="closed" display="oms.state.closed"/>
Expand Down Expand Up @@ -107,12 +105,6 @@
<event>skip timeout</event>
</transition>

<transition>
<source>confirmed</source>
<target>cancelled</target>
<event>cancel</event>
</transition>

<transition happy="true">
<source>waiting</source>
<target>picking list generation scheduled</target>
Expand Down
21 changes: 7 additions & 14 deletions src/Pyz/Zed/Calculation/CalculationDependencyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Spryker\Zed\Calculation\Communication\Plugin\Calculator\ItemDiscountAmountFullAggregatorPlugin;
use Spryker\Zed\Calculation\Communication\Plugin\Calculator\ItemProductOptionPriceAggregatorPlugin;
use Spryker\Zed\Calculation\Communication\Plugin\Calculator\ItemSubtotalAggregatorPlugin;
use Spryker\Zed\Calculation\Communication\Plugin\Calculator\ItemTaxAmountFullAggregatorPlugin;
use Spryker\Zed\Calculation\Communication\Plugin\Calculator\NetTotalCalculatorPlugin;
use Spryker\Zed\Calculation\Communication\Plugin\Calculator\OrderTaxTotalCalculationPlugin;
use Spryker\Zed\Calculation\Communication\Plugin\Calculator\PriceCalculatorPlugin;
Expand All @@ -42,9 +41,6 @@
use Spryker\Zed\Shipment\Communication\Plugin\Calculation\FilterObsoleteShipmentExpensesCalculatorPlugin;
use Spryker\Zed\Shipment\Communication\Plugin\Calculation\ShipmentTaxRateCalculatorPlugin;
use Spryker\Zed\Shipment\Communication\Plugin\Calculation\ShipmentTotalCalculatorPlugin;
use Spryker\Zed\Tax\Communication\Plugin\Calculator\TaxAmountAfterCancellationCalculatorPlugin;
use Spryker\Zed\Tax\Communication\Plugin\Calculator\TaxAmountCalculatorPlugin;
use Spryker\Zed\Tax\Communication\Plugin\Calculator\TaxRateAverageAggregatorPlugin;
use Spryker\Zed\TaxApp\Communication\Plugin\Calculation\TaxAppCalculationPlugin;
use Spryker\Zed\TaxProductConnector\Communication\Plugin\Calculation\ProductItemTaxRateCalculatorPlugin;

Expand Down Expand Up @@ -122,6 +118,10 @@ class CalculationDependencyProvider extends SprykerCalculationDependencyProvider
* TaxRateAverageAggregatorPlugin - average tax rate for item, used when recalculating canceled amount when refunded
* - Item.taxRateAverageAggregation
*
* TaxAppCalculationPlugin - Calculate tax using external tax application. Replaces all tax calculation plugins above.
* Replaced tax calculation plugins should be moved to {@link \Spryker\Zed\TaxApp\TaxAppDependencyProvider::getFallbackQuoteCalculationPlugins} method.
* Replaced tax calculation plugin stack should include all plugins which were present between extracted tax-related plugins.
*
* ProductItemTaxRateCalculatorPlugin - Sets tax rate to item based on shipping address
* - Item.taxRate
*
Expand Down Expand Up @@ -213,13 +213,10 @@ protected function getQuoteCalculatorPluginStack(Container $container): array
new DiscountAmountAggregatorForGenericAmountPlugin(),
new ItemDiscountAmountFullAggregatorPlugin(),

new TaxAmountCalculatorPlugin(),
new ItemTaxAmountFullAggregatorPlugin(),
new TaxAppCalculationPlugin(),

new PriceToPayAggregatorPlugin(),

new TaxRateAverageAggregatorPlugin(),

new RefundableAmountCalculatorPlugin(),

new CalculateBundlePricesPlugin(),
Expand All @@ -229,7 +226,6 @@ protected function getQuoteCalculatorPluginStack(Container $container): array
new DiscountTotalCalculatorPlugin(),
new RefundTotalCalculatorPlugin(),
new TaxTotalCalculatorPlugin(),
new TaxAppCalculationPlugin(),
new GrandTotalCalculatorPlugin(),
new NetTotalCalculatorPlugin(),

Expand Down Expand Up @@ -261,21 +257,18 @@ protected function getOrderCalculatorPluginStack(Container $container): array
new DiscountAmountAggregatorForGenericAmountPlugin(),
new ItemDiscountAmountFullAggregatorPlugin(),

new TaxAmountCalculatorPlugin(),
new ItemTaxAmountFullAggregatorPlugin(),
new TaxAppCalculationPlugin(),

new PriceToPayAggregatorPlugin(),

new TaxAmountAfterCancellationCalculatorPlugin(),

new RefundableAmountCalculatorPlugin(),

new ExpenseTotalCalculatorPlugin(),
new DiscountTotalCalculatorPlugin(),
new RefundTotalCalculatorPlugin(),
new CanceledTotalCalculationPlugin(),
new OrderTaxTotalCalculationPlugin(),
new TaxAppCalculationPlugin(),

new GrandTotalCalculatorPlugin(),
new NetTotalCalculatorPlugin(),
];
Expand Down
11 changes: 11 additions & 0 deletions src/Pyz/Zed/Oms/OmsDependencyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
use Spryker\Zed\Shipment\Dependency\Plugin\Oms\ShipmentManualEventGrouperPlugin;
use Spryker\Zed\Shipment\Dependency\Plugin\Oms\ShipmentOrderMailExpanderPlugin;
use Spryker\Zed\TaxApp\Communication\Plugin\Oms\Command\SubmitPaymentTaxInvoicePlugin;
use Spryker\Zed\TaxApp\Communication\Plugin\Oms\OrderRefundedEventListenerPlugin;
use Spryker\Zed\WarehouseAllocation\Communication\Plugin\Oms\SalesOrderWarehouseAllocationCommandPlugin;

class OmsDependencyProvider extends SprykerOmsDependencyProvider
Expand Down Expand Up @@ -175,4 +176,14 @@ protected function getTimeoutProcessorPlugins(): array
new InitiationTimeoutProcessorPlugin(),
];
}

/**
* @return array<\Spryker\Zed\OmsExtension\Dependency\Plugin\OmsEventTriggeredListenerPluginInterface>
*/
protected function getOmsEventTriggeredListenerPlugins(): array
{
return [
new OrderRefundedEventListenerPlugin(),
];
}
}
48 changes: 48 additions & 0 deletions src/Pyz/Zed/TaxApp/TaxAppDependencyProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

/**
* This file is part of the Spryker Commerce OS.
* For full license information, please view the LICENSE file that was distributed with this source code.
*/

namespace Pyz\Zed\TaxApp;

use Spryker\Zed\Calculation\Communication\Plugin\Calculator\ItemTaxAmountFullAggregatorPlugin;
use Spryker\Zed\Calculation\Communication\Plugin\Calculator\PriceToPayAggregatorPlugin;
use Spryker\Zed\Tax\Communication\Plugin\Calculator\TaxAmountAfterCancellationCalculatorPlugin;
use Spryker\Zed\Tax\Communication\Plugin\Calculator\TaxAmountCalculatorPlugin;
use Spryker\Zed\Tax\Communication\Plugin\Calculator\TaxRateAverageAggregatorPlugin;
use Spryker\Zed\TaxApp\TaxAppDependencyProvider as SprykerTaxAppDependencyProvider;

class TaxAppDependencyProvider extends SprykerTaxAppDependencyProvider
{
/**
* {@inheritDoc}
*
* @return array<\Spryker\Zed\CalculationExtension\Dependency\Plugin\CalculationPluginInterface>
*/
protected function getFallbackQuoteCalculationPlugins(): array
{
return [
new TaxAmountCalculatorPlugin(),
new ItemTaxAmountFullAggregatorPlugin(),
new PriceToPayAggregatorPlugin(),
new TaxRateAverageAggregatorPlugin(),
];
}

/**
* {@inheritDoc}
*
* @return array<\Spryker\Zed\CalculationExtension\Dependency\Plugin\CalculationPluginInterface>
*/
protected function getFallbackOrderCalculationPlugins(): array
{
return [
new TaxAmountCalculatorPlugin(),
new ItemTaxAmountFullAggregatorPlugin(),
new PriceToPayAggregatorPlugin(),
new TaxAmountAfterCancellationCalculatorPlugin(),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

use Codeception\Test\Unit;
use Generated\Shared\Transfer\ConfigureTaxAppTransfer;
use Generated\Shared\Transfer\DeleteTaxAppTransfer;
use Generated\Shared\Transfer\MessageAttributesTransfer;
use Generated\Shared\Transfer\StoreTransfer;
use PyzTest\Zed\MessageBroker\TaxAppCommunicationTester;

/**
Expand Down Expand Up @@ -55,7 +55,6 @@ public function testConfigureTaxAppMessageIsSuccessfullyHandled(): void
MessageAttributesTransfer::STORE_REFERENCE => static::STORE_REFERENCE,
], [
ConfigureTaxAppTransfer::VENDOR_CODE => static::VENDOR_CODE,
ConfigureTaxAppTransfer::API_URL => 'url',
ConfigureTaxAppTransfer::IS_ACTIVE => true,
]);

Expand All @@ -75,12 +74,12 @@ public function testDeleteTaxAppMessageIsSuccessfullyHandled(): void
$storeTransfer = $this->tester->getAllowedStore();
$this->tester->setStoreReferenceData([$storeTransfer->getName() => static::STORE_REFERENCE]);

$this->createDummyTaxAppConfig($storeTransfer);
$this->createDummyTaxAppConfig();

$deleteTaxAppTransfer = $this->tester->buildDeleteTaxAppTransfer([
MessageAttributesTransfer::STORE_REFERENCE => static::STORE_REFERENCE,
], [
ConfigureTaxAppTransfer::VENDOR_CODE => static::VENDOR_CODE,
DeleteTaxAppTransfer::VENDOR_CODE => static::VENDOR_CODE,
]);

// Act
Expand All @@ -91,16 +90,15 @@ public function testDeleteTaxAppMessageIsSuccessfullyHandled(): void
}

/**
* @param \Generated\Shared\Transfer\StoreTransfer $storeTransfer
*
* @return void
*/
protected function createDummyTaxAppConfig(StoreTransfer $storeTransfer): void
protected function createDummyTaxAppConfig(): void
{
$this->tester->handleTaxAppMessage(
$this->tester->buildConfigureTaxAppTransfer([
MessageAttributesTransfer::STORE_REFERENCE => static::STORE_REFERENCE,
ConfigureTaxAppTransfer::VENDOR_CODE => static::VENDOR_CODE,
ConfigureTaxAppTransfer::IS_ACTIVE => true,
]),
);
}
Expand Down
Loading