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

CC-31565: Update Shipment, Service Points features #2269

Merged
merged 19 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
70fc94d
CC-31565: Update Shipment, Service Points features
dmiseev Oct 24, 2023
4830b61
Merge branch 'master' into bugfix/cc-31565-product-bundle-in-cc
andriitserkovnyi Oct 30, 2023
cd418c6
Update install-the-service-points-feature.md
andriitserkovnyi Oct 30, 2023
1e6a9c3
Merge branch 'master' into bugfix/cc-31565-product-bundle-in-cc
andriitserkovnyi Oct 31, 2023
d9a7fbc
Update install-the-service-points-feature.md
andriitserkovnyi Oct 31, 2023
1adf93d
Update install-the-service-points-feature.md
andriitserkovnyi Oct 31, 2023
825a2f3
Update install-the-service-points-feature.md
andriitserkovnyi Oct 31, 2023
e5108d4
Merge branch 'master' into bugfix/cc-31565-product-bundle-in-cc
andriitserkovnyi Oct 31, 2023
bbfe73a
Update install-the-service-points-feature.md
andriitserkovnyi Oct 31, 2023
d38f22d
Update install-the-service-points-feature.md
andriitserkovnyi Oct 31, 2023
bcdc6f2
Update install-the-shipment-feature.md
andriitserkovnyi Oct 31, 2023
f9c7967
Update install-the-service-points-feature.md
andriitserkovnyi Nov 1, 2023
a558689
Update install-the-service-points-feature.md
andriitserkovnyi Nov 1, 2023
1a4a0f8
Update install-the-service-points-feature.md
andriitserkovnyi Nov 6, 2023
34a375c
Merge branch 'master' into bugfix/cc-31565-product-bundle-in-cc
andriitserkovnyi Nov 6, 2023
efa24bf
names
andriitserkovnyi Nov 6, 2023
0b874b3
names
andriitserkovnyi Nov 6, 2023
bb4fb64
names
andriitserkovnyi Nov 6, 2023
15b115b
Merge branch 'master' into bugfix/cc-31565-product-bundle-in-cc
andriitserkovnyi Nov 6, 2023
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


This document describes how to integrate the Service Points feature into a Spryker project.
This document describes how to install the Service Points feature.

## Install feature core

Expand All @@ -14,15 +14,17 @@ Install the required features:
|--------------|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Spryker Core | {{page.version}} | [Install the Spryker Core feature](/docs/pbc/all/miscellaneous/{{page.version}}/install-and-upgrade/install-features/install-the-spryker-core-feature.html) |

### 1) Install the required modules using Composer
### 1) Install the required modules

Install the required modules using Composer:

```bash
composer require spryker-feature/service-points: "{{page.version}}" --update-with-dependencies
```

{% info_block warningBox "Verification" %}

Make sure that the following modules have been installed:
Make sure the following modules have been installed:

| MODULE | EXPECTED DIRECTORY |
|-------------------------|------------------------------------------------|
Expand Down Expand Up @@ -100,7 +102,7 @@ console frontend:zed:build

{% info_block warningBox "Verification" %}

Make sure that the following changes have been applied in the database:
Make sure the following changes have been applied in the database:

| DATABASE ENTITY | TYPE | EVENT |
|-------------------------------------|--------|---------|
Expand All @@ -114,7 +116,7 @@ Make sure that the following changes have been applied in the database:
| spy_region.uuid | column | created |
| spy_sales_order_item_service_point | table | created |

Make sure that propel entities have been generated successfully by checking their existence. Also, make generated entity classes extending respective Spryker core classes.
Make sure propel entities have been generated successfully by checking their existence. Also, make generated entity classes extending respective Spryker core classes.
andriitserkovnyi marked this conversation as resolved.
Show resolved Hide resolved

| CLASS NAMESPACE | EXTENDS |
|---------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
Expand All @@ -138,7 +140,7 @@ Make sure that propel entities have been generated successfully by checking thei
| \Orm\Zed\SalesServicePoint\Persistence\SpySalesOrderItemServicePoint | \Spryker\Zed\SalesServicePoint\Persistence\Propel\AbstractSpySalesOrderItemServicePoint |
| \Orm\Zed\SalesServicePoint\Persistence\SpySalesOrderItemServicePointQuery | \Spryker\Zed\SalesServicePoint\Persistence\Propel\AbstractSpySalesOrderItemServicePointQuery |

Make sure that the following changes have been applied in transfer objects:
Make sure the following changes have been applied in transfer objects:

| TRANSFER | TYPE | EVENT | PATH |
|-------------------------------------------|-------|---------|---------------------------------------------------------------------------------|
Expand Down Expand Up @@ -250,7 +252,7 @@ class GlueBackendApiApplicationAuthorizationConnectorConfig extends SprykerGlueB

### 4) Import service points

1. Prepare your data according to your requirements using our demo data:
1. Prepare the data according to your requirements using our demo data:

**data/import/common/common/service_point.csv**

Expand All @@ -277,7 +279,7 @@ sp2,DE
| COLUMN | REQUIRED | DATA TYPE | DATA EXAMPLE | DATA EXPLANATION |
|-------------------|-----------|-----------|--------------|-----------------------------------------|
| service_point_key | ✓ | string | sp1 | Unique key of the service point. |
| store_name | ✓ | string | DE | Name of the store to make relation for. |
| store_name | ✓ | string | DE | Store relation for the service point. |

**data/import/common/common/service_point_address.csv**

Expand All @@ -290,13 +292,13 @@ sp2,,DE,Julie-Wolfthorn-Straße,1,,Berlin,10115
| COLUMN | REQUIRED | DATA TYPE | DATA EXAMPLE | DATA EXPLANATION |
|-------------------|-----------|-----------|---------------------------|----------------------------------|
| service_point_key | ✓ | string | sp1 | Unique key of the service point. |
| region_iso2_code | optional | string | DE-BE | Region ISO2 code |
| country_iso2_code | ✓ | string | DE | Country ISO2 code |
| address1 | ✓ | string | Caroline-Michaelis-Straße | First line of address |
| address2 | ✓ | string | 8a | Second line of address |
| address3 | optional | string | 12/1 | Third line of address |
| city | ✓ | string | Berlin | City |
| zip_code | ✓ | string | 10115 | Zip code |
| region_iso2_code | optional | string | DE-BE | Region ISO2 code. |
| country_iso2_code | ✓ | string | DE | Country ISO2 code. |
| address1 | ✓ | string | Caroline-Michaelis-Straße | First line of address. |
| address2 | ✓ | string | 8a | Second line of address. |
| address3 | optional | string | 12/1 | Third line of address. |
| city | ✓ | string | Berlin | City. |
| zip_code | ✓ | string | 10115 | Zip code. |

**data/import/common/common/service_type.csv**

Expand Down Expand Up @@ -325,7 +327,7 @@ s2,sp2,pickup,1
| service_type_key | ✓ | string | pickup | Unique key of the service type. |
| is_active | ✓ | bool | 0 | Defines if the service is active. |

2. Enable data imports at your configuration file—for example:
2. Enable the data imports per your configuration file—for example:

**data/import/local/full_EU.yml**

Expand All @@ -346,11 +348,11 @@ s2,sp2,pickup,1

| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE |
|-------------------------------------|---------------------------------------------------------------|---------------|---------------------------------------------------------------------------------|
| ServicePointDataImportPlugin | Imports service points data into the database. | None | \Spryker\Zed\ServicePointDataImport\Communication\Plugin\DataImport |
| ServicePointStoreDataImportPlugin | Imports service point store relations data into the database. | None | \Spryker\Zed\ServicePointDataImport\Communication\Plugin\DataImport |
| ServicePointAddressDataImportPlugin | Imports service point addresses into the database. | None | \Spryker\Zed\ServicePointDataImport\Communication\Plugin\DataImport |
| ServiceTypeDataImportPlugin | Imports service types into the database. | None | \Spryker\Zed\ServicePointDataImport\Communication\Plugin\DataImport |
| ServiceDataImportPlugin | Imports services into the database. | None | \Spryker\Zed\ServicePointDataImport\Communication\Plugin\DataImport |
| ServicePointDataImportPlugin | Imports service points into the database. | | \Spryker\Zed\ServicePointDataImport\Communication\Plugin\DataImport |
| ServicePointStoreDataImportPlugin | Imports service point store relations into the database. | | \Spryker\Zed\ServicePointDataImport\Communication\Plugin\DataImport |
| ServicePointAddressDataImportPlugin | Imports service point addresses into the database. | | \Spryker\Zed\ServicePointDataImport\Communication\Plugin\DataImport |
| ServiceTypeDataImportPlugin | Imports service types into the database. | | \Spryker\Zed\ServicePointDataImport\Communication\Plugin\DataImport |
| ServiceDataImportPlugin | Imports services into the database. | | \Spryker\Zed\ServicePointDataImport\Communication\Plugin\DataImport |

**src/Pyz/Zed/DataImport/DataImportDependencyProvider.php**

Expand Down Expand Up @@ -431,7 +433,7 @@ console data:import:service-type

{% info_block warningBox "Verification" %}

Make sure that entities were imported to the following database tables respectively:
Make sure the entities have been imported to the following database tables:

- `spy_service_point`
- `spy_service_point_store`
Expand All @@ -445,6 +447,8 @@ Make sure that entities were imported to the following database tables respectiv

1. Append the glossary according to your configuration:

<details>
<summary markdown='span'>Glossary</summary>
```csv
service_point.validation.service_point_key_exists,A service point with the same key already exists.,en_US
service_point.validation.service_point_key_exists,Es existiert bereits eine Servicestelle mit dem gleichen Schlüssel.,de_DE
Expand Down Expand Up @@ -516,7 +520,9 @@ service_points_rest_api.error.endpoint_not_found,The endpoint is not found.,en_U
service_points_rest_api.error.endpoint_not_found,Der Endpunkt wurde nicht gefunden.,de_DE
service_points_rest_api.error.service_point_identifier_is_not_specified,The service point identifier is not specified.,en_US
service_points_rest_api.error.service_point_identifier_is_not_specified,Der Servicestellen-Identifikator ist ungültig.,de_DE
```
```

</details>

2. Import data:

Expand Down Expand Up @@ -545,7 +551,7 @@ class SearchElasticsearchConfig extends SprykerSearchElasticsearchConfig
}
```

2. Set up a new source for Service Points:
2. Set up a source for service points:

```bash
console search:setup:source-map
Expand Down Expand Up @@ -636,8 +642,8 @@ class ServicePointSearchConfig extends SprykerServicePointSearchConfig

| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE |
|-----------------------------------------------------|--------------------------------------------------------------------------------------------------------|---------------|---------------------------------------------------------------------|
| ServicePointSynchronizationDataBulkRepositoryPlugin | Allows synchronizing the service point search table content into Elasticsearch. | None | Spryker\Zed\ServicePointSearch\Communication\Plugin\Synchronization |
| ServicePointPublisherTriggerPlugin | Allows populating service point search table with data and triggering further export to Elasticsearch. | None | Spryker\Zed\ServicePointSearch\Communication\Plugin\Publisher |
| ServicePointSynchronizationDataBulkRepositoryPlugin | Synchronizes the content of the service point search table into Elasticsearch. | | Spryker\Zed\ServicePointSearch\Communication\Plugin\Synchronization |
| ServicePointPublisherTriggerPlugin | Populates the service point search table with data and triggers the export to Elasticsearch. | | Spryker\Zed\ServicePointSearch\Communication\Plugin\Publisher |

**src/Pyz/Zed/Synchronization/SynchronizationDependencyProvider.php**

Expand Down Expand Up @@ -691,11 +697,11 @@ class PublisherDependencyProvider extends SprykerPublisherDependencyProvider

| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE |
|-----------------------------------------|-----------------------------------------------------------|---------------|-----------------------------------------------------------------------------------|
| ServicePointWritePublisherPlugin | Listens for events and publishes respective data. | None | Spryker\Zed\ServicePointSearch\Communication\Plugin\Publisher\ServicePoint |
| ServicePointDeletePublisherPlugin | Listens for events and unpublishes respective data. | None | Spryker\Zed\ServicePointSearch\Communication\Plugin\Publisher\ServicePoint |
| ServicePointAddressWritePublisherPlugin | Listens for events and publishes respective data. | None | Spryker\Zed\ServicePointSearch\Communication\Plugin\Publisher\ServicePointAddress |
| ServicePointStoreWritePublisherPlugin | Listens for events and publishes respective data. | None | Spryker\Zed\ServicePointSearch\Communication\Plugin\Publisher\ServicePointStore |
| ServiceWritePublisherPlugin | Listens for service events and publishes respective data. | None | Spryker\Zed\ServicePointSearch\Communication\Plugin\Publisher\Service |
| ServicePointWritePublisherPlugin | Listens for events and publishes respective data. | | Spryker\Zed\ServicePointSearch\Communication\Plugin\Publisher\ServicePoint |
| ServicePointDeletePublisherPlugin | Listens for events and unpublishes respective data. | | Spryker\Zed\ServicePointSearch\Communication\Plugin\Publisher\ServicePoint |
| ServicePointAddressWritePublisherPlugin | Listens for events and publishes respective data. | | Spryker\Zed\ServicePointSearch\Communication\Plugin\Publisher\ServicePointAddress |
| ServicePointStoreWritePublisherPlugin | Listens for events and publishes respective data. | | Spryker\Zed\ServicePointSearch\Communication\Plugin\Publisher\ServicePointStore |
andriitserkovnyi marked this conversation as resolved.
Show resolved Hide resolved
| ServiceWritePublisherPlugin | Listens for service events and publishes respective data. | | Spryker\Zed\ServicePointSearch\Communication\Plugin\Publisher\Service |

**src/Pyz/Zed/Publisher/PublisherDependencyProvider.php**

Expand Down Expand Up @@ -921,7 +927,7 @@ class ServicePointStorageConfig extends SprykerServicePointStorageConfig
{
return SynchronizationConfig::DEFAULT_SYNCHRONIZATION_POOL_NAME;
}

/**
* @return string|null
*/
Expand Down Expand Up @@ -1465,7 +1471,73 @@ service_point_widget.no_results,"Nichts gefunden...",de_DE
console data:import glossary
```

### 2) Enable controllers
### 2) Set up configuration

Add the following configuration to your project:

1. Disable service point selection for product bundles (if it's exists) during checkout:

| CONFIGURATION | SPECIFICATION | NAMESPACE |
|---------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|-----------------------------|
| ServicePointWidgetConfig::getNotApplicableServicePointAddressStepFormItemPropertiesForHydration() | Defines a list of properties in a `ItemTransfer` that are not intended for form hydration. | Pyz\Yves\ServicePointWidget |
| ProductBundleConfig::getAllowedBundleItemFieldsToCopy() | Defines a list of allowed fields to be copied from a source bundle item to destination bundled items. | Pyz\Zed\ProductBundle |

**src/Pyz/Yves/ServicePointWidget/ServicePointWidgetConfig.php**

```php
<?php

namespace Pyz\Yves\ServicePointWidget;

use Generated\Shared\Transfer\ItemTransfer;
use SprykerShop\Yves\ServicePointWidget\ServicePointWidgetConfig as SprykerServicePointWidgetConfig;

class ServicePointWidgetConfig extends SprykerServicePointWidgetConfig
{
/**
* @return list<string>
*/
public function getNotApplicableServicePointAddressStepFormItemPropertiesForHydration(): array
{
return [
ItemTransfer::BUNDLE_ITEM_IDENTIFIER,
ItemTransfer::RELATED_BUNDLE_ITEM_IDENTIFIER,
];
}
}
```

**src/Pyz/Zed/ProductBundle/ProductBundleConfig.php**

```php
<?php

namespace Pyz\Zed\ProductBundle;

use Generated\Shared\Transfer\ItemTransfer;
use Spryker\Zed\ProductBundle\ProductBundleConfig as SprykerProductBundleConfig;

class ProductBundleConfig extends SprykerProductBundleConfig
{
/**
* @return list<string>
*/
public function getAllowedBundleItemFieldsToCopy(): array
{
return [
ItemTransfer::SHIPMENT,
];
}
}
```

{% info_block warningBox "Verification" %}

Make sure that service point selection is not possible for product bundles on the checkout address step (`http://mysprykershop.com/checkout/address`).

{% endinfo_block %}

### 3) Enable controllers

Register the following route providers on the Storefront:

Expand Down Expand Up @@ -1499,7 +1571,7 @@ class RouterDependencyProvider extends SprykerRouterDependencyProvider
}
```

### 3) Set up widgets
### 4) Set up widgets

1. Register the following plugins to enable widgets:

Expand Down
Loading
Loading