Skip to content

Commit

Permalink
Merge pull request #1675 from spryker-shop/feature/cc-34502/dev-order…
Browse files Browse the repository at this point in the history
…-amendment-finalisation

Auto-merge based on green CI result.
  • Loading branch information
spryker-release-bot authored Jan 17, 2025
2 parents 0f14f47 + e0d6037 commit 4d079b7
Show file tree
Hide file tree
Showing 11 changed files with 290 additions and 176 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
"spryker-shop/resource-share-page": "^1.2.0",
"spryker-shop/resource-share-page-extension": "^1.0.0",
"spryker-shop/sales-configurable-bundle-widget": "^1.4.1",
"spryker-shop/sales-order-amendment-widget": "^0.2.0",
"spryker-shop/sales-order-amendment-widget": "^0.3.0",
"spryker-shop/sales-order-threshold-widget": "^1.1.4",
"spryker-shop/sales-product-bundle-widget": "^1.0.0",
"spryker-shop/sales-product-configuration-widget": "^1.0.0",
Expand Down Expand Up @@ -745,7 +745,7 @@
"spryker/oms-multi-thread": "^1.0.0",
"spryker/oms-product-offer-reservation": "^1.0.0",
"spryker/oms-rest-api": "^0.1.0",
"spryker/order-amendments-rest-api": "^0.2.0",
"spryker/order-amendments-rest-api": "^0.3.0",
"spryker/order-custom-reference": "^1.0.0",
"spryker/order-custom-reference-gui": "^1.0.0",
"spryker/order-matrix": "^1.0.0",
Expand Down Expand Up @@ -1061,9 +1061,9 @@
"spryker/sales-merchant-portal-gui": "^3.0.0",
"spryker/sales-merchant-portal-gui-extension": "^1.0.0",
"spryker/sales-oms": "^0.1.0",
"spryker/sales-order-amendment": "^0.2.0",
"spryker/sales-order-amendment": "^0.3.0",
"spryker/sales-order-amendment-extension": "^1.0.0",
"spryker/sales-order-amendment-oms": "^0.2.0",
"spryker/sales-order-amendment-oms": "^0.3.0",
"spryker/sales-order-threshold": "^1.0.0",
"spryker/sales-order-threshold-data-import": "^0.1.0",
"spryker/sales-order-threshold-extension": "^1.0.0",
Expand Down
332 changes: 167 additions & 165 deletions composer.lock

Large diffs are not rendered by default.

22 changes: 21 additions & 1 deletion config/Zed/oms/DummyPayment01.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@
<state name="new" display="oms.state.new">
<flag>cancellable</flag>
</state>
<state name="payment pending" reserved="true" display="oms.state.payment-pending">
<state name="grace period started" reserved="true" display="oms.state.new">
<flag>cancellable</flag>
<flag>amendable</flag>
</state>
<state name="grace period finished" reserved="true" display="oms.state.new">
<flag>cancellable</flag>
</state>
<state name="payment pending" reserved="true" display="oms.state.payment-pending">
<flag>cancellable</flag>
</state>
<state name="invalid" display="oms.state.invalid">
<flag>exclude from customer</flag>
</state>
Expand All @@ -46,6 +52,18 @@
<transitions>
<transition happy="true">
<source>new</source>
<target>grace period started</target>
<event>start grace period</event>
</transition>

<transition happy="true">
<source>grace period started</source>
<target>grace period finished</target>
<event>skip grace period</event>
</transition>

<transition happy="true">
<source>grace period finished</source>
<target>warehouse allocated</target>
<event>allocate warehouse</event>
</transition>
Expand Down Expand Up @@ -162,6 +180,8 @@

<events>
<event name="authorize" timeout="1 second"/>
<event name="start grace period" onEnter="true"/>
<event name="skip grace period" manual="true" timeout="2 hour"/>
<event name="pay" manual="true" timeout="1 hour" timeoutProcessor="OmsTimeout/Initiation" command="DummyPayment/Pay"/>
<event name="submit tax invoice" onEnter="true" command="TaxApp/SubmitPaymentTaxInvoice"/>
<event name="request product review" onEnter="true" command="Order/RequestProductReviews"/>
Expand Down
15 changes: 12 additions & 3 deletions config/Zed/oms/DummySubprocess/DummyOrderAmendment01.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@

<process name="DummyOrderAmendment">
<states>
<state name="order amendment" display="oms.state.order-amendment"/>
<state name="order amendment" display="oms.state.order-amendment">
<flag>amendment in progress</flag>
</state>
</states>

<transitions>
<transition>
<source>payment pending</source>
<source>grace period started</source>
<target>order amendment</target>
<event>start-order-amendment</event>
</transition>
Expand All @@ -25,12 +27,19 @@

<transition>
<source>order amendment</source>
<target>payment pending</target>
<target>grace period started</target>
<event>cancel-order-amendment</event>
</transition>

<transition>
<source>order amendment</source>
<target>grace period finished</target>
<event>skip-order-amendment</event>
</transition>
</transitions>

<events>
<event name="skip-order-amendment"/>
<event name="start-order-amendment"/>
<event name="finish-order-amendment"/>
<event name="cancel-order-amendment"/>
Expand Down
2 changes: 2 additions & 0 deletions data/import/common/common/glossary.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4465,6 +4465,8 @@ sales_order_amendment_oms.validation.order_not_amendable,The order cannot be ame
sales_order_amendment_oms.validation.order_not_amendable,Die Bestellung kann nicht geändert werden.,de_DE
sales_order_amendment_oms.validation.order_does_not_exist,Order with reference %order_reference% could not be found.,en_US
sales_order_amendment_oms.validation.order_does_not_exist,Bestellnummer %order_reference% konnte nicht gefunden werden.,de_DE
sales_order_amendment_oms.validation.order_not_being_amended,This order cannot be edited because the time limit for changes has expired.,en_US
sales_order_amendment_oms.validation.order_not_being_amended,"Eine Bearbeitung dieser Bestellung ist nicht möglich, da die Änderungsfrist abgelaufen ist.",de_DE
sales_order_amendment.validation.sales_order_amendment_does_not_exist,Can not update the sales order amendment with ID %uuid%. Please check the ID.,en_US
sales_order_amendment.validation.sales_order_amendment_does_not_exist,Die Änderung der Bestellung mit der ID %uuid% kann nicht aktualisiert werden. Bitte überprüfen Sie die ID.,de_DE
sales_order_amendment.validation.cart_reorder.order_reference_not_match,"Another order is currently being amended. Complete or cancel the previous amendment before making changes to this order.",en_US
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

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

declare(strict_types = 1);

namespace Orm\Zed\SalesOrderAmendment\Persistence;

use Spryker\Zed\SalesOrderAmendment\Persistence\Propel\AbstractSpySalesOrderAmendmentQuote as BaseSpySalesOrderAmendmentQuote;

/**
* Skeleton subclass for representing a row from the 'spy_sales_order_amendment_quote' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*/
class SpySalesOrderAmendmentQuote extends BaseSpySalesOrderAmendmentQuote
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

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

declare(strict_types = 1);

namespace Orm\Zed\SalesOrderAmendment\Persistence;

use Spryker\Zed\SalesOrderAmendment\Persistence\Propel\AbstractSpySalesOrderAmendmentQuoteQuery as BaseSpySalesOrderAmendmentQuoteQuery;

/**
* Skeleton subclass for performing query and update operations on the 'spy_sales_order_amendment_quote' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*/
class SpySalesOrderAmendmentQuoteQuery extends BaseSpySalesOrderAmendmentQuoteQuery
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
use Spryker\Glue\NavigationsCategoryNodesResourceRelationship\Plugin\GlueApplication\CategoryNodeByResourceIdResourceRelationshipPlugin;
use Spryker\Glue\NavigationsRestApi\NavigationsRestApiConfig;
use Spryker\Glue\NavigationsRestApi\Plugin\ResourceRoute\NavigationsResourceRoutePlugin;
use Spryker\Glue\OrderAmendmentsRestApi\Plugin\GlueApplication\OrderAmendmentsByOrderResourceRelationshipPlugin;
use Spryker\Glue\OrderPaymentsRestApi\Plugin\OrderPaymentsResourceRoutePlugin;
use Spryker\Glue\OrdersRestApi\OrdersRestApiConfig;
use Spryker\Glue\OrdersRestApi\Plugin\CustomerOrdersResourceRoutePlugin;
Expand Down Expand Up @@ -980,6 +981,11 @@ protected function getResourceRelationshipPlugins(
new ShipmentTypesByShipmentMethodsResourceRelationshipPlugin(),
);

$resourceRelationshipCollection->addRelationship(
OrdersRestApiConfig::RESOURCE_ORDERS,
new OrderAmendmentsByOrderResourceRelationshipPlugin(),
);

return $resourceRelationshipCollection;
}

Expand Down
25 changes: 22 additions & 3 deletions src/Pyz/Zed/CartReorder/CartReorderDependencyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,27 @@
use Spryker\Zed\SalesOrderAmendment\Communication\Plugin\CartReorder\AmendmentOrderReferenceCartPreReorderPlugin;
use Spryker\Zed\SalesOrderAmendment\Communication\Plugin\CartReorder\AmendmentQuoteNameCartPreReorderPlugin;
use Spryker\Zed\SalesOrderAmendment\Communication\Plugin\CartReorder\OrderAmendmentCartReorderValidatorPlugin;
use Spryker\Zed\SalesOrderAmendment\Communication\Plugin\CartReorder\OrderAmendmentQuoteProcessFlowExpanderCartPreReorderPlugin;
use Spryker\Zed\SalesOrderAmendmentOms\Communication\Plugin\CartReorder\IsAmendableOrderCartReorderValidatorRulePlugin;
use Spryker\Zed\SalesOrderAmendmentOms\Communication\Plugin\CartReorder\StartOrderAmendmentCartReorderPostCreatePlugin;
use Spryker\Zed\SalesProductConfiguration\Communication\Plugin\CartReorder\ProductConfigurationCartReorderItemHydratorPlugin;

class CartReorderDependencyProvider extends SprykerCartReorderDependencyProvider
{
/**
* @uses \Spryker\Zed\CartReorder\CartReorderConfig::DEFAULT_QUOTE_PROCESS_FLOW_NAME
*
* @var string
*/
protected const DEFAULT_QUOTE_PROCESS_FLOW_NAME = 'default';

/**
* @uses \Spryker\Zed\SalesOrderAmendment\SalesOrderAmendmentConfig::ORDER_AMENDMENT_QUOTE_PROCESS_FLOW_NAME
*
* @var string
*/
protected const ORDER_AMENDMENT_QUOTE_PROCESS_FLOW_NAME = 'order-amendment';

/**
* @return list<\Spryker\Zed\CartReorderExtension\Dependency\Plugin\CartReorderQuoteProviderStrategyPluginInterface>
*/
Expand All @@ -56,13 +71,16 @@ protected function getCartReorderQuoteProviderStrategyPlugins(): array
}

/**
* @return list<\Spryker\Zed\CartReorderExtension\Dependency\Plugin\CartReorderValidatorPluginInterface>
* @return array<string, list<\Spryker\Zed\CartReorderExtension\Dependency\Plugin\CartReorderValidatorPluginInterface>>
*/
protected function getCartReorderValidatorPlugins(): array
{
return [
new OrderAmendmentCartReorderValidatorPlugin(),
new IsAmendableOrderCartReorderValidatorRulePlugin(),
static::DEFAULT_QUOTE_PROCESS_FLOW_NAME => [],
static::ORDER_AMENDMENT_QUOTE_PROCESS_FLOW_NAME => [
new OrderAmendmentCartReorderValidatorPlugin(),
new IsAmendableOrderCartReorderValidatorRulePlugin(),
],
];
}

Expand All @@ -76,6 +94,7 @@ protected function getCartPreReorderPlugins(): array
new CopyOrderPriceModeCartPreReorderPlugin(),
new ProductListRestrictedItemsCartPreReorderPlugin(),
new DefaultReorderQuoteNameCartPreReorderPlugin(),
new OrderAmendmentQuoteProcessFlowExpanderCartPreReorderPlugin(),
new AmendmentOrderReferenceCartPreReorderPlugin(),
new AmendmentQuoteNameCartPreReorderPlugin(),
new ReplaceBundledItemsCartPreReorderPlugin(),
Expand Down
2 changes: 2 additions & 0 deletions src/Pyz/Zed/Checkout/CheckoutDependencyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
use Spryker\Zed\Sales\Communication\Plugin\Checkout\OrderTotalsSaverPlugin;
use Spryker\Zed\Sales\Communication\Plugin\SalesOrderExpanderPlugin;
use Spryker\Zed\SalesOrderAmendmentOms\Communication\Plugin\Checkout\FinishOrderAmendmentCheckoutPostSavePlugin;
use Spryker\Zed\SalesOrderAmendmentOms\Communication\Plugin\Checkout\OrderAmendmentCheckoutPreCheckPlugin;
use Spryker\Zed\SalesOrderThreshold\Communication\Plugin\Checkout\SalesOrderThresholdCheckoutPreConditionPlugin;
use Spryker\Zed\SalesOrderThreshold\Communication\Plugin\Checkout\SalesOrderThresholdExpenseSavePlugin;
use Spryker\Zed\SalesPayment\Communication\Plugin\Checkout\SalesPaymentCheckoutDoSaveOrderPlugin;
Expand Down Expand Up @@ -99,6 +100,7 @@ protected function getCheckoutPreConditions(Container $container): array // phpc
new ShipmentTypeCheckoutPreConditionPlugin(),
new ServicePointCheckoutPreConditionPlugin(),
new ProductQuantityRestrictionCheckoutPreConditionPlugin(),
new OrderAmendmentCheckoutPreCheckPlugin(),
];
}

Expand Down
4 changes: 4 additions & 0 deletions src/Pyz/Zed/Sales/SalesDependencyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
use Spryker\Zed\SalesOms\Communication\Plugin\OrderItemReferenceExpanderPreSavePlugin;
use Spryker\Zed\SalesOrderAmendment\Communication\Plugin\Sales\CreateSalesOrderAmendmentOrderPostSavePlugin;
use Spryker\Zed\SalesOrderAmendment\Communication\Plugin\Sales\SalesOrderAmendmentOrderExpanderPlugin;
use Spryker\Zed\SalesOrderAmendmentOms\Communication\Plugin\Sales\IsAmendableOrderExpanderPlugin;
use Spryker\Zed\SalesOrderAmendmentOms\Communication\Plugin\Sales\IsAmendableOrderSearchOrderExpanderPlugin;
use Spryker\Zed\SalesPayment\Communication\Plugin\Sales\SalesPaymentOrderExpanderPlugin;
use Spryker\Zed\SalesProductConfiguration\Communication\Plugin\Sales\ProductConfigurationOrderItemExpanderPlugin;
use Spryker\Zed\SalesProductConfiguration\Communication\Plugin\Sales\ProductConfigurationOrderItemsPostSavePlugin;
Expand Down Expand Up @@ -118,6 +120,7 @@ protected function getOrderHydrationPlugins(): array
new CurrencyOrderExpanderPlugin(),
new MerchantDataOrderHydratePlugin(),
new SalesOrderAmendmentOrderExpanderPlugin(),
new IsAmendableOrderExpanderPlugin(),
];
}

Expand Down Expand Up @@ -228,6 +231,7 @@ protected function getSearchOrderExpanderPlugins(): array
new ItemMetadataSearchOrderExpanderPlugin(),
new OrderAggregatedItemStateSearchOrderExpanderPlugin(),
new IsCancellableSearchOrderExpanderPlugin(),
new IsAmendableOrderSearchOrderExpanderPlugin(),
];
}

Expand Down

0 comments on commit 4d079b7

Please sign in to comment.