Skip to content

Commit

Permalink
Merge pull request #1415 from spryker-shop/feature/cc-30854/dev-servi…
Browse files Browse the repository at this point in the history
…ce-point-shipping-address

Auto-merge based on green CI result.
  • Loading branch information
spryker-release-bot authored Oct 25, 2023
2 parents 1e3c08d + aecd2f0 commit 468699b
Show file tree
Hide file tree
Showing 19 changed files with 1,619 additions and 164 deletions.
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
"spryker-shop/shared-cart-page": "^2.4.1",
"spryker-shop/shared-cart-widget": "^1.7.0",
"spryker-shop/shipment-page": "^0.1.0",
"spryker-shop/shipment-type-widget": "^0.1.0",
"spryker-shop/shipment-type-widget": "^0.2.0",
"spryker-shop/shop-application": "^1.12.1",
"spryker-shop/shop-application-extension": "^1.0.0",
"spryker-shop/shop-cms-slot": "^1.0.0",
Expand Down Expand Up @@ -864,11 +864,11 @@
"spryker/product-offer-service-point-storage": "^0.3.0",
"spryker/product-offer-service-point-storage-extension": "^1.0.0",
"spryker/product-offer-shipment-type": "^0.2.0",
"spryker/product-offer-shipment-type-availability": "^0.1.0",
"spryker/product-offer-shipment-type-availability": "^0.2.0",
"spryker/product-offer-shipment-type-data-import": "^0.2.0",
"spryker/product-offer-shipment-type-gui": "^0.1.0",
"spryker/product-offer-shipment-type-merchant-portal-gui": "^0.1.0",
"spryker/product-offer-shipment-type-storage": "^0.3.0",
"spryker/product-offer-shipment-type-storage": "^0.4.0",
"spryker/product-offer-shipment-type-storage-extension": "^1.0.0",
"spryker/product-offer-shopping-list": "^1.0.0",
"spryker/product-offer-shopping-list-data-import": "^0.1.0",
Expand Down Expand Up @@ -1045,7 +1045,7 @@
"spryker/service-point-search": "^0.3.0",
"spryker/service-point-storage": "^0.4.0",
"spryker/service-points-backend-api": "^0.4.0",
"spryker/service-points-rest-api": "^0.4.0",
"spryker/service-points-rest-api": "^0.5.0",
"spryker/session": "^4.10.0",
"spryker/session-customer-validation": "^1.0.0",
"spryker/session-customer-validation-extension": "^1.0.0",
Expand Down Expand Up @@ -1075,12 +1075,12 @@
"spryker/shipment-type-product-offer-service-point-availabilities-rest-api": "^0.1.0",
"spryker/shipment-type-service-point": "^0.4.0",
"spryker/shipment-type-service-point-data-import": "^0.4.0",
"spryker/shipment-type-service-point-storage": "^0.1.0",
"spryker/shipment-type-storage": "^0.1.0",
"spryker/shipment-type-service-point-storage": "^0.2.0",
"spryker/shipment-type-service-points-rest-api": "^0.1.0",
"spryker/shipment-type-storage": "^0.2.0",
"spryker/shipment-type-storage-extension": "^0.1.0",
"spryker/shipment-types-backend-api": "^0.2.0",
"spryker/shipment-types-rest-api": "^0.2.0",
"spryker/shipment-types-service-points-resource-relationship": "^0.3.0",
"spryker/shipment-types-rest-api": "^0.3.0",
"spryker/shipments-backend-api": "^1.0.0",
"spryker/shipments-rest-api": "^1.5.0",
"spryker/shipments-rest-api-extension": "^1.0.0",
Expand Down
319 changes: 166 additions & 153 deletions composer.lock

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions src/Pyz/Glue/CheckoutRestApi/CheckoutRestApiConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace Pyz\Glue\CheckoutRestApi;

use Generated\Shared\Transfer\RestCustomerTransfer;
use Spryker\Glue\CheckoutRestApi\CheckoutRestApiConfig as SprykerCheckoutRestApiConfig;

class CheckoutRestApiConfig extends SprykerCheckoutRestApiConfig
Expand Down Expand Up @@ -104,4 +105,15 @@ public function isAddressesMappedToAttributes(): bool
{
return false;
}

/**
* @return list<string>
*/
public function getRequiredCustomerRequestDataForGuestCheckout(): array
{
return array_merge(parent::getRequiredCustomerRequestDataForGuestCheckout(), [
RestCustomerTransfer::FIRST_NAME,
RestCustomerTransfer::LAST_NAME,
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
use Spryker\Glue\ShipmentsRestApi\Plugin\CheckoutRestApi\AddressSourceCheckoutRequestValidatorPlugin;
use Spryker\Glue\ShipmentsRestApi\Plugin\CheckoutRestApi\SelectedShipmentMethodCheckoutDataResponseMapperPlugin;
use Spryker\Glue\ShipmentsRestApi\Plugin\CheckoutRestApi\ShipmentDataCheckoutRequestValidatorPlugin;
use Spryker\Glue\ShipmentTypeServicePointsRestApi\Plugin\CheckoutRestApi\ShipmentTypeServicePointCheckoutRequestAttributesValidatorPlugin;
use Spryker\Glue\ShipmentTypeServicePointsRestApi\Plugin\CheckoutRestApi\ShipmentTypeServicePointCheckoutRequestExpanderPlugin;
use Spryker\Glue\ShipmentTypesRestApi\Plugin\CheckoutRestApi\SelectedShipmentTypesCheckoutDataResponseMapperPlugin;

class CheckoutRestApiDependencyProvider extends SprykerCheckoutRestApiDependencyProvider
Expand All @@ -28,6 +30,7 @@ protected function getCheckoutRequestAttributesValidatorPlugins(): array
return [
new SinglePaymentCheckoutRequestAttributesValidatorPlugin(),
new ServicePointCheckoutRequestAttributesValidatorPlugin(),
new ShipmentTypeServicePointCheckoutRequestAttributesValidatorPlugin(),
];
}

Expand Down Expand Up @@ -62,6 +65,7 @@ protected function getCheckoutRequestExpanderPlugins(): array
{
return [
new CompanyUserCheckoutRequestExpanderPlugin(),
new ShipmentTypeServicePointCheckoutRequestExpanderPlugin(),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@
use Spryker\Glue\ShipmentsRestApi\Plugin\GlueApplication\ShipmentMethodsByShipmentResourceRelationshipPlugin;
use Spryker\Glue\ShipmentsRestApi\Plugin\GlueApplication\ShipmentsByCheckoutDataResourceRelationshipPlugin;
use Spryker\Glue\ShipmentsRestApi\ShipmentsRestApiConfig;
use Spryker\Glue\ShipmentTypeServicePointsRestApi\Plugin\GlueApplication\ServiceTypeByShipmentTypesResourceRelationshipPlugin;
use Spryker\Glue\ShipmentTypesRestApi\Plugin\GlueApplication\ShipmentTypesByShipmentMethodsResourceRelationshipPlugin;
use Spryker\Glue\ShipmentTypesRestApi\Plugin\GlueApplication\ShipmentTypesResourceRoutePlugin;
use Spryker\Glue\ShipmentTypesRestApi\ShipmentTypesRestApiConfig;
use Spryker\Glue\ShipmentTypesServicePointsResourceRelationship\Plugin\GlueApplication\ServiceTypeByShipmentTypesResourceRelationshipPlugin;
use Spryker\Glue\ShoppingListsRestApi\Plugin\GlueApplication\ShoppingListItemByShoppingListResourceRelationshipPlugin;
use Spryker\Glue\ShoppingListsRestApi\Plugin\GlueApplication\ShoppingListItemsResourcePlugin;
use Spryker\Glue\ShoppingListsRestApi\Plugin\GlueApplication\ShoppingListsResourcePlugin;
Expand Down
21 changes: 21 additions & 0 deletions src/Pyz/Glue/ShipmentsRestApi/ShipmentsRestApiConfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?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.
*/

namespace Pyz\Glue\ShipmentsRestApi;

use Spryker\Glue\ShipmentsRestApi\ShipmentsRestApiConfig as SprykerShipmentsRestApiConfig;

class ShipmentsRestApiConfig extends SprykerShipmentsRestApiConfig
{
/**
* @return bool
*/
public function shouldExecuteShippingAddressValidationStrategyPlugins(): bool
{
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
use Spryker\Glue\CompanyBusinessUnitAddressesRestApi\Plugin\ShipmentsRestApi\CompanyBusinessUnitAddressSourceCheckerPlugin;
use Spryker\Glue\CustomersRestApi\Plugin\ShipmentsRestApi\CustomerAddressSourceCheckerPlugin;
use Spryker\Glue\ShipmentsRestApi\ShipmentsRestApiDependencyProvider as SprykerShipmentsRestApiDependencyProvider;
use Spryker\Glue\ShipmentTypeServicePointsRestApi\Plugin\ShipmentsRestApi\MultiShipmentTypeServicePointShippingAddressValidationStrategyPlugin;
use Spryker\Glue\ShipmentTypeServicePointsRestApi\Plugin\ShipmentsRestApi\SingleShipmentTypeServicePointShippingAddressValidationStrategyPlugin;

class ShipmentsRestApiDependencyProvider extends SprykerShipmentsRestApiDependencyProvider
{
Expand All @@ -23,4 +25,15 @@ protected function getAddressSourceCheckerPlugins(): array
new CustomerAddressSourceCheckerPlugin(),
];
}

/**
* @return list<\Spryker\Glue\ShipmentsRestApiExtension\Dependency\Plugin\ShippingAddressValidationStrategyPluginInterface>
*/
protected function getShippingAddressValidationStrategyPlugins(): array
{
return [
new MultiShipmentTypeServicePointShippingAddressValidationStrategyPlugin(),
new SingleShipmentTypeServicePointShippingAddressValidationStrategyPlugin(),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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.
*/

namespace Pyz\Shared\ShipmentTypeServicePointsRestApi;

use Spryker\Shared\ShipmentTypeServicePointsRestApi\ShipmentTypeServicePointsRestApiConfig as SprykerShipmentTypeServicePointsRestApiConfig;

class ShipmentTypeServicePointsRestApiConfig extends SprykerShipmentTypeServicePointsRestApiConfig
{
/**
* @var string
*/
protected const SHIPMENT_TYPE_KEY_PICKUP = 'pickup';

/**
* @return list<string>
*/
public function getApplicableShipmentTypeKeysForShippingAddress(): array
{
return [static::SHIPMENT_TYPE_KEY_PICKUP];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Spryker\Zed\ShipmentsRestApi\Communication\Plugin\CheckoutRestApi\ShipmentMethodCheckoutDataValidatorPlugin;
use Spryker\Zed\ShipmentsRestApi\Communication\Plugin\CheckoutRestApi\ShipmentQuoteMapperPlugin;
use Spryker\Zed\ShipmentsRestApi\Communication\Plugin\CheckoutRestApi\ShipmentsQuoteMapperPlugin;
use Spryker\Zed\ShipmentTypeServicePointsRestApi\Communication\Plugin\CheckoutRestApi\ShipmentTypeServicePointQuoteMapperPlugin;
use Spryker\Zed\ShipmentTypesRestApi\Communication\Plugin\CheckoutRestApi\ItemShipmentTypeQuoteMapperPlugin;
use Spryker\Zed\ShipmentTypesRestApi\Communication\Plugin\CheckoutRestApi\ShipmentTypeCheckoutDataValidatorPlugin;
use Spryker\Zed\ShipmentTypesRestApi\Communication\Plugin\CheckoutRestApi\ShipmentTypeReadCheckoutDataValidatorPlugin;
Expand All @@ -47,6 +48,7 @@ protected function getQuoteMapperPlugins(): array
new ShipmentsQuoteMapperPlugin(),
new ServicePointQuoteMapperPlugin(),
new ItemShipmentTypeQuoteMapperPlugin(),
new ShipmentTypeServicePointQuoteMapperPlugin(),
];
}

Expand Down
8 changes: 8 additions & 0 deletions src/Pyz/Zed/Publisher/PublisherDependencyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@
use Spryker\Zed\ServicePointStorage\Communication\Plugin\Publisher\ServicePointStore\ServicePointStoreWritePublisherPlugin as ServicePointStorageStoreWritePublisherPlugin;
use Spryker\Zed\ServicePointStorage\Communication\Plugin\Publisher\ServiceType\ServiceTypeWritePublisherPlugin;
use Spryker\Zed\ServicePointStorage\Communication\Plugin\Publisher\ServiceTypePublisherTriggerPlugin;
use Spryker\Zed\ShipmentTypeStorage\Communication\Plugin\Publisher\ShipmentCarrier\ShipmentCarrierShipmentTypeWriterPublisherPlugin;
use Spryker\Zed\ShipmentTypeStorage\Communication\Plugin\Publisher\ShipmentMethod\ShipmentMethodPublishShipmentTypeWriterPublisherPlugin;
use Spryker\Zed\ShipmentTypeStorage\Communication\Plugin\Publisher\ShipmentMethod\ShipmentMethodShipmentTypeWriterPublisherPlugin;
use Spryker\Zed\ShipmentTypeStorage\Communication\Plugin\Publisher\ShipmentMethodStore\ShipmentMethodStoreShipmentTypeWriterPublisherPlugin;
use Spryker\Zed\ShipmentTypeStorage\Communication\Plugin\Publisher\ShipmentType\ShipmentTypeWriterPublisherPlugin;
use Spryker\Zed\ShipmentTypeStorage\Communication\Plugin\Publisher\ShipmentTypePublisherTriggerPlugin;
use Spryker\Zed\ShipmentTypeStorage\Communication\Plugin\Publisher\ShipmentTypeStore\ShipmentTypeStoreWriterPublisherPlugin;
Expand Down Expand Up @@ -700,6 +704,10 @@ protected function getShipmentTypeStoragePlugins(): array
return [
new ShipmentTypeWriterPublisherPlugin(),
new ShipmentTypeStoreWriterPublisherPlugin(),
new ShipmentCarrierShipmentTypeWriterPublisherPlugin(),
new ShipmentMethodPublishShipmentTypeWriterPublisherPlugin(),
new ShipmentMethodShipmentTypeWriterPublisherPlugin(),
new ShipmentMethodStoreShipmentTypeWriterPublisherPlugin(),
];
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<database xmlns="spryker:schema-01" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="zed" namespace="Orm\Zed\Shipment\Persistence" package="src.Orm.Zed.Shipment.Persistence" xsi:schemaLocation="spryker:schema-01 https://static.spryker.com/schema-01.xsd">

<table name="spy_shipment_carrier">
<behavior name="event">
<parameter name="spy_shipment_carrier_is_active" column="is_active"/>
</behavior>
</table>

<table name="spy_shipment_method">
<behavior name="event">
<parameter name="spy_shipment_method_is_active" column="is_active"/>
<parameter name="spy_shipment_method_fk_shipment_type" column="fk_shipment_type"/>
<parameter name="spy_shipment_method_fk_shipment_carrier" column="fk_shipment_carrier"/>
</behavior>
</table>

<table name="spy_shipment_method_store">
<behavior name="event">
<parameter name="spy_shipment_method_store_all" column="*"/>
</behavior>
</table>

</database>
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ public function buildFixtures(CheckoutApiTester $I): FixturesContainerInterface
ShipmentTypeTransfer::STORE_RELATION => (new StoreRelationTransfer())
->addStores($I->haveStore([StoreTransfer::NAME => 'DE'])),
]);
$I->addShipmentTypeToShipmentMethod($this->shipmentMethodTransfer, $this->shipmentTypeTransfer);
$I->haveShipmentMethodShipmentTypeRelation(
$this->shipmentMethodTransfer->getIdShipmentMethodOrFail(),
$this->shipmentTypeTransfer->getIdShipmentTypeOrFail(),
);

$this->quoteTransfer = $I->havePersistentQuoteWithItemsAndItemLevelShipment(
$this->customerTransfer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ public function buildFixtures(CheckoutApiTester $I): FixturesContainerInterface
ShipmentTypeTransfer::STORE_RELATION => (new StoreRelationTransfer())
->addStores($I->haveStore([StoreTransfer::NAME => 'DE'])),
]);
$I->addShipmentTypeToShipmentMethod($this->shipmentMethodTransfer, $this->shipmentTypeTransfer);
$I->haveShipmentMethodShipmentTypeRelation(
$this->shipmentMethodTransfer->getIdShipmentMethodOrFail(),
$this->shipmentTypeTransfer->getIdShipmentTypeOrFail(),
);

$this->guestQuoteTransfer = $I->havePersistentQuoteWithItemsAndItemLevelShipment(
$this->guestCustomerTransfer,
Expand Down
Loading

0 comments on commit 468699b

Please sign in to comment.