-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ price list feature migration (#87)
* 📦 migrate bundle from fond-of-spryker/price-product-price-list-page-search-extension * 📦 migrate bundle from fond-of-spryker/price-product-price-list * 📦 migrate package from fond-of-spryker/price-list-gui * 📦 migrate package from fond-of-spryker/company-price-list * 📦 migrate package fond-of-spryker/price-lists-rest-api * 📦 migrate package fond-of-spryker/company-business-unit-price-list * 📦 migrate package fond-of-spryker/customer-price-list * 📦 migrate package fond-of-spryker/price-product-price-list-gui * 📦 migrate package fond-of-spryker/company-price-list-gui * 📦 migrate package fond-of-spryker/price-list-api * 📦 migrate package fond-of-spryker/price-product-price-list-page-search * 📦 migrate package fond-of-spryker/price-product-price-list-page-search * 📦 migrate package fond-of-spryker/customer-price-product-price-list-page-search * 📦 migrate bundle from fond-of-spryker/price-list * 📦 migrate package fond-of-spryker/price-product-price-list-search-rest-api
- Loading branch information
0 parents
commit 4f66384
Showing
54 changed files
with
3,080 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
continous-integration: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-versions: [ "8.0", "8.1", "8.2" ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup PHP, with composer and extensions | ||
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extensions: mbstring, dom, fileinfo, pgsql, json | ||
coverage: xdebug #optional | ||
- name: Get composer cache directory | ||
id: composercache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- name: Cache composer dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composercache.outputs.dir }} | ||
# Use composer.json for key, if composer.lock is not committed. | ||
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
- name: Install dependencies and run ci tasks | ||
run: make install ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.idea | ||
|
||
.DS_Store | ||
|
||
vendor | ||
composer.lock | ||
src/Generated | ||
src/Orm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2023-present FOND OF GmbH | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.PHONY: install | ||
install: | ||
composer install | ||
|
||
.PHONY: phpcs | ||
phpcs: | ||
./vendor/bin/phpcs --standard=./vendor/spryker/code-sniffer/Spryker/ruleset.xml ./src/FondOfImpala/* ./tests/* | ||
|
||
.PHONY: phpcbf | ||
phpcbf: | ||
./vendor/bin/phpcbf --standard=./vendor/spryker/code-sniffer/Spryker/ruleset.xml ./src/FondOfImpala/* ./tests/* | ||
|
||
.PHONY: phpstan | ||
phpstan: | ||
./vendor/bin/phpstan --memory-limit=-1 analyse ./src/FondOfImpala | ||
|
||
.PHONY: codeception | ||
codeception: | ||
./vendor/bin/codecept run --env standalone | ||
|
||
.PHONY: ci | ||
ci: phpcs codeception phpstan | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -Rf composer.lock | ||
rm -Rf ./vendor | ||
find ./tests/_output/ -not -name .gitignore -delete | ||
rm -Rf src/Generated/* | ||
rm -Rf src/Orm/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Price List Module | ||
[![CI](https://github.com/fond-of-impala/price-list/actions/workflows/main.yml/badge.svg)](https://github.com/fond-of-impala/price-list/actions/workflows/main.yml) | ||
[![license](https://img.shields.io/github/license/fond-of-impala/price-list.svg)](https://packagist.org/packages/fond-of-impala/price-list) | ||
|
||
Package was migrated from `fond-of-spryker/price-list` | ||
|
||
## Installation | ||
|
||
``` | ||
composer require fond-of-impala/price-list | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
namespace: fond-of-impala/price-list | ||
|
||
suites: | ||
unit: | ||
path: . | ||
|
||
settings: | ||
shuffle: true | ||
lint: true | ||
|
||
bootstrap: _bootstrap.php | ||
|
||
paths: | ||
tests: tests | ||
output: tests/_output | ||
support: tests/_support | ||
data: tests/_data | ||
|
||
coverage: | ||
enabled: true | ||
include: | ||
- src/*.php | ||
|
||
modules: | ||
enabled: | ||
- \FondOfCodeception\Module\Spryker | ||
config: | ||
\FondOfCodeception\Module\Spryker: | ||
generate_transfer: false | ||
generate_map_classes: false | ||
generate_propel_classes: false | ||
generate_ide_auto_completion: false | ||
|
||
env: | ||
standalone: | ||
modules: | ||
config: | ||
\FondOfCodeception\Module\Spryker: | ||
generate_transfer: true | ||
generate_map_classes: true | ||
generate_propel_classes: true | ||
generate_ide_auto_completion: true | ||
monorepo: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "fond-of-impala/price-list", | ||
"description": "Price list", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Daniel Rose", | ||
"email": "daniel-rose@gmx.de" | ||
} | ||
], | ||
"scripts": { | ||
"ci": "make ci", | ||
"codeception": "make codeception", | ||
"phpcs": "make phpcs", | ||
"phpstan": "make phpstan" | ||
}, | ||
"require": { | ||
"php": ">=8.0", | ||
"fond-of-oryx/price-list-extension": "^1.0.0" | ||
}, | ||
"require-dev": { | ||
"fond-of-codeception/spryker": "*", | ||
"spryker/code-sniffer": "*", | ||
"spryker-sdk/phpstan-spryker": "*" | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"autoload": { | ||
"psr-4": { | ||
"FondOfImpala\\": "src/FondOfImpala/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"FondOfImpala\\": "tests/FondOfImpala/", | ||
"Generated\\": "src/Generated/", | ||
"Orm\\": "src/Orm/" | ||
} | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"dealerdirect/phpcodesniffer-composer-installer": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
parameters: | ||
level: 4 | ||
reportUnmatchedIgnoredErrors: false | ||
scanDirectories: | ||
- src/Orm/Zed | ||
- src/Generated | ||
ignoreErrors: | ||
- '#.* on an unknown class Generated\\(Client|Glue|Service|Yves|Zed)\\Ide\\AutoCompletion.*#' |
31 changes: 31 additions & 0 deletions
31
src/FondOfImpala/Client/PriceList/Dependency/Client/PriceListToZedRequestClientBridge.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace FondOfImpala\Client\PriceList\Dependency\Client; | ||
|
||
use Spryker\Client\ZedRequest\ZedRequestClientInterface; | ||
use Spryker\Shared\Kernel\Transfer\TransferInterface; | ||
|
||
class PriceListToZedRequestClientBridge implements PriceListToZedRequestClientInterface | ||
{ | ||
protected ZedRequestClientInterface $zedRequestClient; | ||
|
||
/** | ||
* @param \Spryker\Client\ZedRequest\ZedRequestClientInterface $zedRequestClient | ||
*/ | ||
public function __construct(ZedRequestClientInterface $zedRequestClient) | ||
{ | ||
$this->zedRequestClient = $zedRequestClient; | ||
} | ||
|
||
/** | ||
* @param string $url | ||
* @param \Spryker\Shared\Kernel\Transfer\TransferInterface $object | ||
* @param array|null $requestOptions | ||
* | ||
* @return \Spryker\Shared\Kernel\Transfer\TransferInterface | ||
*/ | ||
public function call(string $url, TransferInterface $object, ?array $requestOptions = null): TransferInterface | ||
{ | ||
return $this->zedRequestClient->call($url, $object, $requestOptions); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/FondOfImpala/Client/PriceList/Dependency/Client/PriceListToZedRequestClientInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace FondOfImpala\Client\PriceList\Dependency\Client; | ||
|
||
use Spryker\Shared\Kernel\Transfer\TransferInterface; | ||
|
||
interface PriceListToZedRequestClientInterface | ||
{ | ||
/** | ||
* @param string $url | ||
* @param \Spryker\Shared\Kernel\Transfer\TransferInterface $object | ||
* @param array|null $requestOptions | ||
* | ||
* @return \Spryker\Shared\Kernel\Transfer\TransferInterface | ||
*/ | ||
public function call(string $url, TransferInterface $object, ?array $requestOptions = null): TransferInterface; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace FondOfImpala\Client\PriceList; | ||
|
||
use Generated\Shared\Transfer\PriceListListTransfer; | ||
use Spryker\Client\Kernel\AbstractClient; | ||
|
||
/** | ||
* @method \FondOfImpala\Client\PriceList\PriceListFactory getFactory() | ||
*/ | ||
class PriceListClient extends AbstractClient implements PriceListClientInterface | ||
{ | ||
/** | ||
* @param \Generated\Shared\Transfer\PriceListListTransfer $priceListListTransfer | ||
* | ||
* @return \Generated\Shared\Transfer\PriceListListTransfer | ||
*/ | ||
public function findPriceLists(PriceListListTransfer $priceListListTransfer): PriceListListTransfer | ||
{ | ||
return $this->getFactory()->createZedPriceListStub()->findPriceLists($priceListListTransfer); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/FondOfImpala/Client/PriceList/PriceListClientInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace FondOfImpala\Client\PriceList; | ||
|
||
use Generated\Shared\Transfer\PriceListListTransfer; | ||
|
||
interface PriceListClientInterface | ||
{ | ||
/** | ||
* Specification: | ||
* - Finds price lists by criteria from PriceListListTransfer. | ||
* | ||
* @api | ||
* | ||
* @param \Generated\Shared\Transfer\PriceListListTransfer $priceListListTransfer | ||
* | ||
* @return \Generated\Shared\Transfer\PriceListListTransfer | ||
*/ | ||
public function findPriceLists( | ||
PriceListListTransfer $priceListListTransfer | ||
): PriceListListTransfer; | ||
} |
39 changes: 39 additions & 0 deletions
39
src/FondOfImpala/Client/PriceList/PriceListDependencyProvider.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace FondOfImpala\Client\PriceList; | ||
|
||
use FondOfImpala\Client\PriceList\Dependency\Client\PriceListToZedRequestClientBridge; | ||
use Spryker\Client\Kernel\AbstractDependencyProvider; | ||
use Spryker\Client\Kernel\Container; | ||
|
||
class PriceListDependencyProvider extends AbstractDependencyProvider | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public const CLIENT_ZED_REQUEST = 'CLIENT_ZED_REQUEST'; | ||
|
||
/** | ||
* @param \Spryker\Client\Kernel\Container $container | ||
* | ||
* @return \Spryker\Client\Kernel\Container | ||
*/ | ||
public function provideServiceLayerDependencies(Container $container): Container | ||
{ | ||
$container = parent::provideServiceLayerDependencies($container); | ||
|
||
return $this->addZedRequestClient($container); | ||
} | ||
|
||
/** | ||
* @param \Spryker\Client\Kernel\Container $container | ||
* | ||
* @return \Spryker\Client\Kernel\Container | ||
*/ | ||
protected function addZedRequestClient(Container $container): Container | ||
{ | ||
$container[static::CLIENT_ZED_REQUEST] = static fn (Container $container): PriceListToZedRequestClientBridge => new PriceListToZedRequestClientBridge($container->getLocator()->zedRequest()->client()); | ||
|
||
return $container; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace FondOfImpala\Client\PriceList; | ||
|
||
use FondOfImpala\Client\PriceList\Dependency\Client\PriceListToZedRequestClientInterface; | ||
use FondOfImpala\Client\PriceList\Zed\PriceListStub; | ||
use FondOfImpala\Client\PriceList\Zed\PriceListStubInterface; | ||
use Spryker\Client\Kernel\AbstractFactory; | ||
|
||
class PriceListFactory extends AbstractFactory | ||
{ | ||
/** | ||
* @return \FondOfImpala\Client\PriceList\Zed\PriceListStubInterface | ||
*/ | ||
public function createZedPriceListStub(): PriceListStubInterface | ||
{ | ||
return new PriceListStub($this->getZedRequestClient()); | ||
} | ||
|
||
/** | ||
* @return \FondOfImpala\Client\PriceList\Dependency\Client\PriceListToZedRequestClientInterface | ||
*/ | ||
protected function getZedRequestClient(): PriceListToZedRequestClientInterface | ||
{ | ||
return $this->getProvidedDependency(PriceListDependencyProvider::CLIENT_ZED_REQUEST); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace FondOfImpala\Client\PriceList\Zed; | ||
|
||
use FondOfImpala\Client\PriceList\Dependency\Client\PriceListToZedRequestClientInterface; | ||
use Generated\Shared\Transfer\PriceListListTransfer; | ||
|
||
class PriceListStub implements PriceListStubInterface | ||
{ | ||
protected PriceListToZedRequestClientInterface $zedRequestClient; | ||
|
||
/** | ||
* @param \FondOfImpala\Client\PriceList\Dependency\Client\PriceListToZedRequestClientInterface $zedRequestClient | ||
*/ | ||
public function __construct(PriceListToZedRequestClientInterface $zedRequestClient) | ||
{ | ||
$this->zedRequestClient = $zedRequestClient; | ||
} | ||
|
||
/** | ||
* @param \Generated\Shared\Transfer\PriceListListTransfer $priceListListTransfer | ||
* | ||
* @return \Generated\Shared\Transfer\PriceListListTransfer | ||
*/ | ||
public function findPriceLists(PriceListListTransfer $priceListListTransfer): PriceListListTransfer | ||
{ | ||
/** @var \Generated\Shared\Transfer\PriceListListTransfer $priceListListTransfer */ | ||
$priceListListTransfer = $this->zedRequestClient->call( | ||
'/price-list/gateway/find-price-lists', | ||
$priceListListTransfer, | ||
); | ||
|
||
return $priceListListTransfer; | ||
} | ||
} |
Oops, something went wrong.