Skip to content

Commit

Permalink
Merge pull request #1372 from spryker-shop/feature/cc-30636/dev-servi…
Browse files Browse the repository at this point in the history
…ce-type-and-shipment-type-glue-api-relationships

Auto-merge based on green CI result.
  • Loading branch information
spryker-release-bot authored Sep 5, 2023
2 parents b9b3bdf + 45f875c commit 611a762
Show file tree
Hide file tree
Showing 13 changed files with 440 additions and 77 deletions.
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"spryker-shop/sales-service-point-widget": "^0.1.0",
"spryker-shop/security-blocker-page": "^1.0.0",
"spryker-shop/service-point-cart-page": "^0.1.0",
"spryker-shop/service-point-widget": "^0.3.0",
"spryker-shop/service-point-widget": "^0.4.0",
"spryker-shop/session-agent-validation": "^1.0.0",
"spryker-shop/session-agent-validation-extension": "^1.0.0",
"spryker-shop/session-customer-validation-page": "^1.0.0",
Expand Down Expand Up @@ -853,7 +853,7 @@
"spryker/product-offer-service-point-availability-calculator-extension": "^0.1.0",
"spryker/product-offer-service-point-availability-extension": "^0.1.0",
"spryker/product-offer-service-point-data-import": "^0.2.0",
"spryker/product-offer-service-point-storage": "^0.2.0",
"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",
Expand Down Expand Up @@ -1032,9 +1032,9 @@
"spryker/service-point-cart-extension": "^0.1.0",
"spryker/service-point-data-import": "^0.4.0",
"spryker/service-point-search": "^0.3.0",
"spryker/service-point-storage": "^0.3.0",
"spryker/service-point-storage": "^0.4.0",
"spryker/service-points-backend-api": "^0.4.0",
"spryker/service-points-rest-api": "^0.2.0",
"spryker/service-points-rest-api": "^0.3.0",
"spryker/session": "^4.10.0",
"spryker/session-customer-validation": "^1.0.0",
"spryker/session-customer-validation-extension": "^1.0.0",
Expand All @@ -1061,12 +1061,13 @@
"spryker/shipment-type": "^0.1.0",
"spryker/shipment-type-cart": "^0.1.0",
"spryker/shipment-type-data-import": "^0.1.0",
"spryker/shipment-type-service-point": "^0.2.0",
"spryker/shipment-type-service-point-data-import": "^0.2.0",
"spryker/shipment-type-service-point": "^0.3.0",
"spryker/shipment-type-service-point-data-import": "^0.3.0",
"spryker/shipment-type-storage": "^0.1.0",
"spryker/shipment-type-storage-extension": "^0.1.0",
"spryker/shipment-types-backend-api": "^0.2.0",
"spryker/shipment-types-rest-api": "^0.1.0",
"spryker/shipment-types-service-points-resource-relationship": "^0.1.0",
"spryker/shipments-backend-api": "^0.2.0",
"spryker/shipments-rest-api": "^1.5.0",
"spryker/shipments-rest-api-extension": "^1.0.0",
Expand Down
193 changes: 123 additions & 70 deletions composer.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?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 Orm\Zed\ServicePointStorage\Persistence;

use Spryker\Zed\ServicePointStorage\Persistence\Propel\AbstractSpyServiceTypeStorage as BaseSpyServiceTypeStorage;

/**
* Skeleton subclass for representing a row from the 'spy_service_type_storage' 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 SpyServiceTypeStorage extends BaseSpyServiceTypeStorage
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?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 Orm\Zed\ServicePointStorage\Persistence;

use Spryker\Zed\ServicePointStorage\Persistence\Propel\AbstractSpyServiceTypeStorageQuery as BaseSpyServiceTypeStorageQuery;

/**
* Skeleton subclass for performing query and update operations on the 'spy_service_type_storage' 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 SpyServiceTypeStorageQuery extends BaseSpyServiceTypeStorageQuery
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,28 @@
namespace Pyz\Client\ShipmentTypeStorage;

use Spryker\Client\ProductOfferShipmentTypeStorage\Plugin\ShipmentTypeStorage\ShipmentTypeProductOfferAvailableShipmentTypeFilterPlugin;
use Spryker\Client\ShipmentTypeServicePoint\Plugin\ShipmentTypeStorage\ServiceTypeShipmentTypeStorageExpanderPlugin;
use Spryker\Client\ShipmentTypeStorage\ShipmentTypeStorageDependencyProvider as SprykerShipmentTypeStorageDependencyProvider;

class ShipmentTypeStorageDependencyProvider extends SprykerShipmentTypeStorageDependencyProvider
{
/**
* @return array<\Spryker\Client\ShipmentTypeStorageExtension\Dependency\Plugin\AvailableShipmentTypeFilterPluginInterface>
* @return list<\Spryker\Client\ShipmentTypeStorageExtension\Dependency\Plugin\AvailableShipmentTypeFilterPluginInterface>
*/
protected function getAvailableShipmentTypeFilterPlugins(): array
{
return [
new ShipmentTypeProductOfferAvailableShipmentTypeFilterPlugin(),
];
}

/**
* @return list<\Spryker\Client\ShipmentTypeStorageExtension\Dependency\Plugin\ShipmentTypeStorageExpanderPluginInterface>
*/
protected function getShipmentTypeStorageExpanderPlugins(): array
{
return [
new ServiceTypeShipmentTypeStorageExpanderPlugin(),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@
use Spryker\Glue\ShipmentsRestApi\Plugin\GlueApplication\ShipmentsByCheckoutDataResourceRelationshipPlugin;
use Spryker\Glue\ShipmentsRestApi\ShipmentsRestApiConfig;
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 Expand Up @@ -952,6 +954,11 @@ protected function getResourceRelationshipPlugins(
new ServicePointAddressesByServicePointUuidResourceRelationshipPlugin(),
);

$resourceRelationshipCollection->addRelationship(
ShipmentTypesRestApiConfig::RESOURCE_SHIPMENT_TYPES,
new ServiceTypeByShipmentTypesResourceRelationshipPlugin(),
);

return $resourceRelationshipCollection;
}

Expand Down
4 changes: 4 additions & 0 deletions src/Pyz/Zed/Publisher/PublisherDependencyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@
use Spryker\Zed\ServicePointStorage\Communication\Plugin\Publisher\ServicePointAddress\ServicePointAddressWritePublisherPlugin as ServicePointStorageAddressWritePublisherPlugin;
use Spryker\Zed\ServicePointStorage\Communication\Plugin\Publisher\ServicePointPublisherTriggerPlugin as ServicePointStoragePublisherTriggerPlugin;
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\ShipmentType\ShipmentTypeWriterPublisherPlugin;
use Spryker\Zed\ShipmentTypeStorage\Communication\Plugin\Publisher\ShipmentTypePublisherTriggerPlugin;
use Spryker\Zed\ShipmentTypeStorage\Communication\Plugin\Publisher\ShipmentTypeStore\ShipmentTypeStoreWriterPublisherPlugin;
Expand Down Expand Up @@ -265,6 +267,7 @@ protected function getPublisherTriggerPlugins(): array
new CustomerAccessPublisherTriggerPlugin(),
new ServicePointPublisherTriggerPlugin(),
new ServicePointStoragePublisherTriggerPlugin(),
new ServiceTypePublisherTriggerPlugin(),
new ShipmentTypePublisherTriggerPlugin(),
new ProductOfferServicePublisherTriggerPlugin(),
new ProductOfferShipmentTypePublisherTriggerPlugin(),
Expand Down Expand Up @@ -661,6 +664,7 @@ protected function getServicePointStoragePlugins(): array
new ServicePointStorageAddressWritePublisherPlugin(),
new ServicePointStorageStoreWritePublisherPlugin(),
new ServicePointStorageServiceWritePublisherPlugin(),
new ServiceTypeWritePublisherPlugin(),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@
</behavior>
</table>

<table name="spy_service_type">
<behavior name="event">
<parameter name="spy_service_type_all" column="*"/>
</behavior>
</table>

</database>
8 changes: 8 additions & 0 deletions src/Pyz/Zed/ServicePointStorage/ServicePointStorageConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ public function getServicePointStorageSynchronizationPoolName(): ?string
return SynchronizationConfig::DEFAULT_SYNCHRONIZATION_POOL_NAME;
}

/**
* @return string|null
*/
public function getServiceTypeStorageSynchronizationPoolName(): ?string
{
return SynchronizationConfig::DEFAULT_SYNCHRONIZATION_POOL_NAME;
}

/**
* @return string|null
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
use Spryker\Zed\SearchHttp\Communication\Plugin\Synchronization\SearchHttpSynchronizationDataPlugin;
use Spryker\Zed\ServicePointSearch\Communication\Plugin\Synchronization\ServicePointSynchronizationDataBulkRepositoryPlugin;
use Spryker\Zed\ServicePointStorage\Communication\Plugin\Synchronization\ServicePointSynchronizationDataBulkRepositoryPlugin as ServicePointStorageSynchronizationDataBulkRepositoryPlugin;
use Spryker\Zed\ServicePointStorage\Communication\Plugin\Synchronization\ServiceTypeSynchronizationDataBulkRepositoryPlugin;
use Spryker\Zed\ShipmentTypeStorage\Communication\Plugin\Synchronization\ShipmentTypeSynchronizationDataBulkRepositoryPlugin;
use Spryker\Zed\ShoppingListStorage\Communication\Plugin\Synchronization\ShoppingListSynchronizationDataBulkPlugin;
use Spryker\Zed\StoreStorage\Communication\Plugin\Synchronization\StoreSynchronizationDataPlugin;
Expand Down Expand Up @@ -169,6 +170,7 @@ protected function getSynchronizationDataPlugins(): array
new SearchHttpSynchronizationDataPlugin(),
new ServicePointSynchronizationDataBulkRepositoryPlugin(),
new ServicePointStorageSynchronizationDataBulkRepositoryPlugin(),
new ServiceTypeSynchronizationDataBulkRepositoryPlugin(),
new ShipmentTypeSynchronizationDataBulkRepositoryPlugin(),
new ProductOfferServiceSynchronizationDataBulkRepositoryPlugin(),
new ProductOfferShipmentTypeSynchronizationDataBulkRepositoryPlugin(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace PyzTest\Glue\ShipmentTypes\RestApi;

use Generated\Shared\Transfer\ServiceTypeTransfer;
use Generated\Shared\Transfer\ShipmentTypeTransfer;
use Generated\Shared\Transfer\StoreRelationTransfer;
use Generated\Shared\Transfer\StoreTransfer;
Expand All @@ -32,6 +33,11 @@ class ShipmentTypesRestApiFixtures implements FixturesBuilderInterface, Fixtures
*/
protected array $shipmentTypes = [];

/**
* @var \Generated\Shared\Transfer\ServiceTypeTransfer
*/
protected ServiceTypeTransfer $serviceTypeTransfer;

/**
* @param \PyzTest\Glue\ShipmentTypes\ShipmentTypesApiTester $I
*
Expand All @@ -43,6 +49,8 @@ public function buildFixtures(ShipmentTypesApiTester $I): FixturesContainerInter
$this->createActiveShipmentType($I, ['DE']),
$this->createActiveShipmentType($I, ['DE']),
];
$this->serviceTypeTransfer = $this->createServiceType($I);
$this->createShipmentTypeServiceTypeRelation($I);

return $this;
}
Expand All @@ -55,6 +63,14 @@ public function getShipmentTypes(): array
return $this->shipmentTypes;
}

/**
* @return \Generated\Shared\Transfer\ServiceTypeTransfer
*/
public function getServiceTypeTransfer(): ServiceTypeTransfer
{
return $this->serviceTypeTransfer;
}

/**
* @param \PyzTest\Glue\ShipmentTypes\ShipmentTypesApiTester $I
* @param list<string> $storeNames
Expand All @@ -73,4 +89,27 @@ protected function createActiveShipmentType(ShipmentTypesApiTester $I, array $st
ShipmentTypeTransfer::STORE_RELATION => $storeRelationTransfer,
]);
}

/**
* @param \PyzTest\Glue\ShipmentTypes\ShipmentTypesApiTester $I
*
* @return \Generated\Shared\Transfer\ServiceTypeTransfer
*/
protected function createServiceType(ShipmentTypesApiTester $I): ServiceTypeTransfer
{
return $I->haveServiceType();
}

/**
* @param \PyzTest\Glue\ShipmentTypes\ShipmentTypesApiTester $I
*
* @return void
*/
protected function createShipmentTypeServiceTypeRelation(ShipmentTypesApiTester $I): void
{
$I->haveShipmentTypeServiceTypeRelation(
$this->shipmentTypes[0],
$this->serviceTypeTransfer,
);
}
}
Loading

0 comments on commit 611a762

Please sign in to comment.