From 6a8b4f0c413deee5f590758e954c644ee41ec398 Mon Sep 17 00:00:00 2001 From: Roman S Date: Mon, 4 Jun 2018 17:40:15 +0300 Subject: [PATCH] PS-1472: Enabler: Create infrastructure (#3281) * PS-1515: Init ProductList module * PS-1516: Init ProductListDataImport module * PS-1515: Init ProductListGui module * PS-1520: Init ProductListSearch module * PS-1521: Init ProductListStorage module * PS-1522: Init MerchantRelationship module * PS-1518: Init MerchantRelationshipProductList module * PS-1519: Init MerchantRelationshipProductListDataImport module * PS-1516: Added missed tester to ProductListDataImport module. * PS-1523: Defined DB schema for ProductList module * PS-1524: Created Propel Models * PS-1535: Initialized UtilCsv module. * Initialised MerchantRelationshipProductListGui module. --- .coveralls.yml | 3 + .gitattributes | 32 +++++++++ .gitignore | 16 +++++ .travis.yml | 28 ++++++++ CHANGELOG.md | 3 + LICENSE | 40 +++++++++++ README.md | 15 ++++ codeception.yml | 21 ++++++ composer.json | 35 ++++++++++ phpstan.json | 3 + .../Transfer/product_list.transfer.xml | 6 ++ .../Business/ProductListBusinessFactory.php | 17 +++++ .../Business/ProductListFacade.php | 17 +++++ .../Business/ProductListFacadeInterface.php | 12 ++++ .../Dependency/ProductListEvents.php | 12 ++++ .../Persistence/ProductListEntityManager.php | 14 ++++ .../ProductListEntityManagerInterface.php | 12 ++++ .../Persistence/ProductListRepository.php | 14 ++++ .../ProductListRepositoryInterface.php | 12 ++++ .../Propel/AbstractSpyProductList.php | 24 +++++++ .../Propel/AbstractSpyProductListCategory.php | 24 +++++++ .../AbstractSpyProductListCategoryQuery.php | 24 +++++++ .../AbstractSpyProductListProductConcrete.php | 24 +++++++ ...ractSpyProductListProductConcreteQuery.php | 24 +++++++ .../Propel/AbstractSpyProductListQuery.php | 24 +++++++ .../Propel/Schema/spy_product_list.schema.xml | 70 +++++++++++++++++++ .../Zed/ProductList/ProductListConfig.php | 14 ++++ .../ProductListDependencyProvider.php | 14 ++++ .../Business/ProductListFacadeTest.php | 29 ++++++++ .../_support/ProductListBusinessTester.php | 34 +++++++++ .../Zed/ProductList/codeception.yml | 25 +++++++ 31 files changed, 642 insertions(+) create mode 100644 .coveralls.yml create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 CHANGELOG.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 codeception.yml create mode 100644 composer.json create mode 100644 phpstan.json create mode 100644 src/Spryker/Shared/ProductList/Transfer/product_list.transfer.xml create mode 100644 src/Spryker/Zed/ProductList/Business/ProductListBusinessFactory.php create mode 100644 src/Spryker/Zed/ProductList/Business/ProductListFacade.php create mode 100644 src/Spryker/Zed/ProductList/Business/ProductListFacadeInterface.php create mode 100644 src/Spryker/Zed/ProductList/Dependency/ProductListEvents.php create mode 100644 src/Spryker/Zed/ProductList/Persistence/ProductListEntityManager.php create mode 100644 src/Spryker/Zed/ProductList/Persistence/ProductListEntityManagerInterface.php create mode 100644 src/Spryker/Zed/ProductList/Persistence/ProductListRepository.php create mode 100644 src/Spryker/Zed/ProductList/Persistence/ProductListRepositoryInterface.php create mode 100644 src/Spryker/Zed/ProductList/Persistence/Propel/AbstractSpyProductList.php create mode 100644 src/Spryker/Zed/ProductList/Persistence/Propel/AbstractSpyProductListCategory.php create mode 100644 src/Spryker/Zed/ProductList/Persistence/Propel/AbstractSpyProductListCategoryQuery.php create mode 100644 src/Spryker/Zed/ProductList/Persistence/Propel/AbstractSpyProductListProductConcrete.php create mode 100644 src/Spryker/Zed/ProductList/Persistence/Propel/AbstractSpyProductListProductConcreteQuery.php create mode 100644 src/Spryker/Zed/ProductList/Persistence/Propel/AbstractSpyProductListQuery.php create mode 100644 src/Spryker/Zed/ProductList/Persistence/Propel/Schema/spy_product_list.schema.xml create mode 100644 src/Spryker/Zed/ProductList/ProductListConfig.php create mode 100644 src/Spryker/Zed/ProductList/ProductListDependencyProvider.php create mode 100644 tests/SprykerTest/Zed/ProductList/Business/ProductListFacadeTest.php create mode 100644 tests/SprykerTest/Zed/ProductList/_support/ProductListBusinessTester.php create mode 100644 tests/SprykerTest/Zed/ProductList/codeception.yml diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 0000000..be4561e --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1,3 @@ +coverage_clover: tests/_output/coverage.xml +json_path: tests/_output/coveralls-upload.json +service_name: travis-ci diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dd657dd --- /dev/null +++ b/.gitattributes @@ -0,0 +1,32 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* eol=lf +* text=auto + +# Denote all files that are truly binary and should not be modified. +*.png binary +*.jpg binary +*.gif binary +*.jpeg binary +*.zip binary +*.phar binary +*.ttf binary +*.woff binary +*.woff2 binary +*.eot binary +*.ico binary +*.mo binary +*.pdf binary +*.xsd binary +*.ts binary +*.exe binary + +# Remove files for archives generated using `git archive` +codeception.yml export-ignore +dependency.json export-ignore +.coveralls.yml export-ignore +.travis.yml export-ignore +.editorconfig export-ignore +.gitattributes export-ignore +.gitignore export-ignore +phpstan.neon +phpstan.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1b7fde3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +# IDEs +/.idea +/.project +/nbproject +/.buildpath +/.settings +*.sublime-* +*.AppleDouble +*.AppleDB +*.AppleDesktop + +# OS +.DS_Store + +/tests/_output/* +!/tests/_output/.gitkeep diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f4d56fb --- /dev/null +++ b/.travis.yml @@ -0,0 +1,28 @@ +language: php + +php: + - 7.1 + - 7.2 + +cache: + directories: + - vendor + - $HOME/.composer/cache + +env: + global: + - APPLICATION_ENV=development + - APPLICATION_STORE=DE + +install: + - composer install --no-interaction --prefer-dist + +script: + - vendor/bin/phpcs src --standard=vendor/spryker/code-sniffer/Spryker/ruleset.xml + - vendor/bin/codecept run --env isolated --coverage-xml + +after_success: + - vendor/bin/coveralls -vvv + +notifications: + email: false diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..6c2bec8 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +# ProductList Changelog + +[Release Changelog](https://github.com/spryker/product-list/releases) diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d376fd6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,40 @@ +SPRYKER SYSTEMS GMBH EVALUATION LICENSE AGREEMENT + +SPRYKER SYSTEMS GMBH, REGISTERED WITH THE COMMERCIAL REGISTER OF THE LOWER COURT OF HAMBURG UNDER HRB 134310 +(“WE” OR ”SPRYKER”)GRANTS YOU (THE “LICENSEE”) THE RIGHT TO USE THE SOFTWARE (AS DEFINED BELOW) +UNDER THE PROVISIONS OF THIS EVALUATION LICENSE AGREEMENT (THE “AGREEMENT”). + +The “Software” includes any software owned and distributed by Spryker under this Agreement. The Software +contains elements of open source components, to which different license terms apply respectively. +These open source components are needed to be installed separately. + +Spryker grants to Licensee, during the 45-calendar-day period (the “Evaluation Period”) following the download of the Software, +the nontransferable, nonexclusive limited, free of charge license to permit Licensee’s employees to internally use the Software +to test and evaluate the Software in connection with potentially purchasing non-evaluation licenses to the Software. + +Licensee shall not (i) use the Software to set up a productive live system, for development purposes or any other purposes apart +from evaluating the Software; (ii) copy any part of the Software except to make one copy for back-up purposes; (iii) distribute, +disclose, market, rent, lease, or transfer the Software or act as a service bureau with respect to the Software; (iv) export the +Software or install it in multiple locations; (v) disclose any confidential information provided by Spryker; (vi) modify or make +derivative works of the Software; or (vii) allow others to make or obtain copies of the Software. + +THE SOFTWARE IS PROVIDED “AS-IS” AND WITHOUT WARRANTY OF ANY KIND. SPRYKER DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, TITLE, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. SPRYKER WILL NOT +BE LIABLE FOR ANY DAMAGES ASSOCIATED WITH THE SOFTWARE, INCLUDING WITHOUT LIMITATION ORDINARY, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL +DAMAGES OF ANY KIND, INCLUDING BUT NOT LIMITED TO DAMAGES RELATING TO LOST DATA OR LOST PROFITS, EVEN IF SPRYKER HAS BEEN ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES. + +Licensee's license to use the Software shall terminate on the earlier of (i) the expiration of the Evaluation Period, or (ii) the date +both parties enter into a definitive agreement for the provision by Spryker to Licensee of a non-evaluation license to the Software. +Upon termination of the license as provided above, Licensee shall promptly destroy the Software and any back-up copy of the Software +made during the Evaluation Period if Spryker and the Licensee have not agreed a non-evaluation license to the Software. + +This Agreement shall be governed by the laws of Germany to the exclusion of IPR (International Law) and the United Nations Convention +on Contracts for the International Sale of Goods (CISG). The parties consent to the jurisdiction of the courts in Berlin (Germany). + +This Agreement is not assignable or transferable by Licensee and any attempt to do so is null and void. + +This Agreement constitutes the entire agreement between the parties concerning Licensee’s use of the Software. This Agreement supersedes +any prior verbal understanding between the parties and any Licensee purchase order or other ordering document, regardless of whether such +document is received by Spryker before or after execution of this Agreement. This Agreement may be amended only in a writing signed by +an authorized officer of Spryker. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a9a8db2 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# ProductList Module +[![Build Status](https://travis-ci.org/spryker/product-list.svg)](https://travis-ci.org/spryker/product-list) +[![Coverage Status](https://coveralls.io/repos/github/spryker/product-list/badge.svg)](https://coveralls.io/github/spryker/product-list) + +ProductList provides infrastructure and functionality to handle white/black lists of a concrete products for a specific merchants. + +## Installation + +``` +composer require spryker/product-list +``` + +## Documentation + +[Spryker Documentation](https://academy.spryker.com/developing_with_spryker/module_guide/modules.html) diff --git a/codeception.yml b/codeception.yml new file mode 100644 index 0000000..e454a34 --- /dev/null +++ b/codeception.yml @@ -0,0 +1,21 @@ +namespace: ProductList +actor: Tester + +include: + - tests/SprykerTest/Zed/ProductList + +paths: + tests: tests + log: tests/_output + data: tests/_data + support: tests/_support + envs: tests/_envs +settings: + bootstrap: _bootstrap.php + suite_class: \PHPUnit_Framework_TestSuite + colors: true + memory_limit: 1024M + log: true +coverage: + enabled: true + whitelist: { include: ['src/*.php'] } diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..7d080d4 --- /dev/null +++ b/composer.json @@ -0,0 +1,35 @@ +{ + "name": "spryker/product-list", + "description": "ProductList module", + "license": "proprietary", + "require": { + "php": ">=7.1", + "spryker/category": "^3.0.0 || ^4.0.0", + "spryker/kernel": "^3.20.0", + "spryker/product": "^5.0.0 || ^6.0.0" + }, + "require-dev": { + "spryker/code-sniffer": "*", + "spryker/testify": "*" + }, + "autoload": { + "psr-4": { + "Spryker\\": "src/Spryker/" + } + }, + "autoload-dev": { + "psr-4": { + "SprykerTest\\": "tests/SprykerTest/" + } + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "config": { + "sort-packages": true + } +} diff --git a/phpstan.json b/phpstan.json new file mode 100644 index 0000000..5853d23 --- /dev/null +++ b/phpstan.json @@ -0,0 +1,3 @@ +{ + "defaultLevel": 5 +} diff --git a/src/Spryker/Shared/ProductList/Transfer/product_list.transfer.xml b/src/Spryker/Shared/ProductList/Transfer/product_list.transfer.xml new file mode 100644 index 0000000..c6cee7d --- /dev/null +++ b/src/Spryker/Shared/ProductList/Transfer/product_list.transfer.xml @@ -0,0 +1,6 @@ + + + + diff --git a/src/Spryker/Zed/ProductList/Business/ProductListBusinessFactory.php b/src/Spryker/Zed/ProductList/Business/ProductListBusinessFactory.php new file mode 100644 index 0000000..0467d2f --- /dev/null +++ b/src/Spryker/Zed/ProductList/Business/ProductListBusinessFactory.php @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
\ No newline at end of file diff --git a/src/Spryker/Zed/ProductList/ProductListConfig.php b/src/Spryker/Zed/ProductList/ProductListConfig.php new file mode 100644 index 0000000..039bce2 --- /dev/null +++ b/src/Spryker/Zed/ProductList/ProductListConfig.php @@ -0,0 +1,14 @@ +