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

refactor: pseventbus v4 #341

Open
wants to merge 236 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
236 commits
Select commit Hold shift + click to select a range
0843e8e
refactor: rework hooks with traits
fox-john Jul 26, 2024
0f258bb
refactor: synchronization service and connected services
fox-john Jul 26, 2024
30bed65
feature: add upgrade script
fox-john Jul 29, 2024
df955c4
fix: update service.yml
fox-john Jul 29, 2024
431f372
feat: add front service
fox-john Jul 29, 2024
bcc66e6
refactor: remove all old front controllers
fox-john Jul 29, 2024
56a8fbe
feat: rework orders for testing
fox-john Jul 29, 2024
5a2b675
fix: all hooks
fox-john Jul 29, 2024
342ac89
fix: common problems
fox-john Jul 29, 2024
3af9abf
fix: common problems
fox-john Jul 31, 2024
52565b1
fix: debug mode
fox-john Jul 31, 2024
094c264
fix: update services and error handler
fox-john Aug 1, 2024
9468ad9
fix: service
fox-john Aug 1, 2024
434a520
feat: add healthcheck mecanic
fox-john Aug 1, 2024
9f1aef1
chore: set healhcheck to shopcontent
fox-john Aug 1, 2024
cafb6f5
fix: problem with service declaration
fox-john Aug 1, 2024
df11e8d
fix: config
fox-john Aug 2, 2024
addcc45
e2e: change all endpoint and rename controller into shoContent
fox-john Aug 2, 2024
99d8fc0
fix: healtcheck
fox-john Aug 6, 2024
7a08f68
fix: phpcs-fixer
fox-john Aug 6, 2024
98b9c00
fix: phpcs-fixer and phpstan
fox-john Aug 7, 2024
36a8d76
fix: compat 5.6
fox-john Aug 8, 2024
1f657d6
fix: compat ps 1.6.1.11
fox-john Aug 8, 2024
7da1ef8
fix: php-cs-fixer
fox-john Aug 8, 2024
1c4bca0
fix: e2e env
fox-john Aug 8, 2024
9665258
fix: rename json dump
fox-john Aug 8, 2024
10e1367
fix: bug e2e
fox-john Aug 8, 2024
668ccf4
Merge branch 'main' into feature/pseventbus-v4-base
jokesterfr Aug 22, 2024
b962dde
fix: common problems
fox-john Aug 26, 2024
3934d01
Merge branch 'feature/pseventbus-v4-base' of https://github.com/Prest…
fox-john Aug 26, 2024
5d0580a
refactor: rework hooks with traits
fox-john Jul 26, 2024
4095f73
refactor: synchronization service and connected services
fox-john Jul 26, 2024
9cf2a68
feature: add upgrade script
fox-john Jul 29, 2024
009fa4d
fix: update service.yml
fox-john Jul 29, 2024
b2da088
feat: add front service
fox-john Jul 29, 2024
72d3cd0
refactor: remove all old front controllers
fox-john Jul 29, 2024
934fd04
feat: rework orders for testing
fox-john Jul 29, 2024
48c41ec
fix: all hooks
fox-john Jul 29, 2024
8c837c8
fix: common problems
fox-john Jul 29, 2024
79102f7
fix: common problems
fox-john Jul 31, 2024
b4d496e
fix: debug mode
fox-john Jul 31, 2024
6d1f3c0
fix: update services and error handler
fox-john Aug 1, 2024
ca572c8
fix: service
fox-john Aug 1, 2024
2bbdc94
feat: add healthcheck mecanic
fox-john Aug 1, 2024
511c54f
chore: set healhcheck to shopcontent
fox-john Aug 1, 2024
25c1e5f
fix: problem with service declaration
fox-john Aug 1, 2024
a5addbd
fix: config
fox-john Aug 2, 2024
3a77e40
e2e: change all endpoint and rename controller into shoContent
fox-john Aug 2, 2024
d96a90e
fix: healtcheck
fox-john Aug 6, 2024
51177f1
fix: phpcs-fixer
fox-john Aug 6, 2024
f5c182a
fix: phpcs-fixer and phpstan
fox-john Aug 7, 2024
8315918
fix: compat 5.6
fox-john Aug 8, 2024
41e5a2a
fix: compat ps 1.6.1.11
fox-john Aug 8, 2024
532327f
fix: php-cs-fixer
fox-john Aug 8, 2024
5ec0b28
fix: e2e env
fox-john Aug 8, 2024
44066b0
fix: rename json dump
fox-john Aug 8, 2024
2459168
fix: bug e2e
fox-john Aug 8, 2024
25aeca4
fix: common problems
fox-john Aug 26, 2024
d02301b
Merge branch 'feature/pseventbus-v4-base' of https://github.com/Prest…
fox-john Aug 27, 2024
5117b4b
fix: phpcs-fixer and phpstan
fox-john Aug 27, 2024
01fed97
fix: autoload
fox-john Aug 27, 2024
5366fcd
fix: rename ordersRepository to orderRepository
fox-john Aug 27, 2024
cd74111
chore: move old file for clearly visualisation of code
fox-john Aug 29, 2024
973b503
chore: change method for clearly view of code
fox-john Aug 29, 2024
e40f05e
feat: pseventbus v4 order cart rules (#347)
fox-john Aug 29, 2024
6355441
feat: pseventbus v4 order statuse histories (#349)
fox-john Aug 30, 2024
5026005
feat: pseventbus v4 order details (#350)
fox-john Sep 4, 2024
2b47db3
feat: pseventbus v4 carriers (#353)
fox-john Sep 9, 2024
e99ffb6
feat: pseventbus v4 carrier details and taxes (#354)
fox-john Sep 11, 2024
226d177
feat: pseventbus v4 carts (#355)
fox-john Sep 11, 2024
bf42d62
feat: pseventbus v4 cart products (#356)
fox-john Sep 12, 2024
51383db
fix: bug
fox-john Sep 12, 2024
a11a6ee
feat: pseventbus v4 cart rules (#358)
fox-john Sep 13, 2024
6d4ee3b
feat: pseventbus v4 products (#361)
fox-john Sep 17, 2024
54ea7aa
feat: pseventbus v4 product bundles (#363)
fox-john Sep 17, 2024
b37f373
fix: lint js
fox-john Sep 17, 2024
b330408
fix: lint js
fox-john Sep 17, 2024
d8e6928
fix: test latest
fox-john Sep 17, 2024
0073668
fix: disable type-cast for 1.7
fox-john Sep 18, 2024
ec50e4d
feat: add product suppliers (#364)
fox-john Sep 18, 2024
7a72c72
feat: pseventbus v4 product carriers (#365)
fox-john Sep 18, 2024
62c8e76
Merge branch 'main' into feature/pseventbus-v4-base
fox-john Sep 18, 2024
b00e719
feat: pseventbus v4 categories (#366)
fox-john Sep 20, 2024
ea3c827
feat: pseventbus v4 customers (#367)
fox-john Sep 20, 2024
4ac48de
feat: pseventbus v4 currencies (#368)
fox-john Sep 20, 2024
6884b2d
Feat: pseventbus v4 employees (#369)
fox-john Sep 20, 2024
7f9ea0b
feat: pseventbus v4 images and images types (#370)
fox-john Sep 20, 2024
e6f1259
feat: pseventbus v4 infos (#371)
fox-john Sep 24, 2024
780a980
feat: add modules
fox-john Sep 24, 2024
76111af
fix: shop_informations name
fox-john Sep 24, 2024
0495b5a
feat: fpseventbus v4 themes (#372)
fox-john Sep 26, 2024
749df28
feat: pseventbus v4 wishlists and wishlist products (#373)
fox-john Sep 26, 2024
cc021d8
feat: add languages (#374)
fox-john Sep 26, 2024
3603539
fix: add header stamps
fox-john Sep 26, 2024
c88470f
fix: add check for define version
fox-john Sep 26, 2024
113237a
fix: problem with header stamp
fox-john Sep 26, 2024
940538e
fix: last problems
fox-john Sep 26, 2024
7d285a1
feat: add manufacturers (#375)
fox-john Sep 27, 2024
d2f63f5
feat: pseventbus v4 translations (#376)
fox-john Sep 30, 2024
b5cf102
feat: add stock and stock mvmts (#377)
fox-john Sep 30, 2024
92db6fc
feat: pseventbus v4 specific prices (#378)
fox-john Sep 30, 2024
803dd32
feat: add taxonomies (#379)
fox-john Oct 1, 2024
a91dd2b
feat: add suppliers (#380)
fox-john Oct 1, 2024
42181ac
feat: last edits for v4 (#381)
fox-john Oct 2, 2024
06207f2
Merge branch 'main' into feature/pseventbus-v4-base
fox-john Oct 2, 2024
56dd4db
fix: error with merge
fox-john Oct 2, 2024
ff365e4
fix: phpcs-fixer and phpstan
fox-john Oct 2, 2024
8b689c6
fix: error
fox-john Oct 2, 2024
067931e
fix: useless code
fox-john Oct 2, 2024
03bc961
fix: last problems
fox-john Oct 3, 2024
ea344c7
fix: some errors
fox-john Oct 3, 2024
72619a1
fix: useless code in error handler
fox-john Oct 3, 2024
50e2832
fix: problem after merge main
fox-john Oct 3, 2024
1aaae1a
fix: phpcs-fixer and phpstan
fox-john Oct 3, 2024
f37c775
fix: e2e
fox-john Oct 3, 2024
6d48ad8
chore: add fixme
fox-john Oct 4, 2024
8e5a770
fix: debug mode and anothers query params
fox-john Oct 4, 2024
98f1c4a
chore: ordering services and repository and rename product carrier sh…
fox-john Oct 7, 2024
481a1aa
fix: last rename
fox-john Oct 7, 2024
5b9e8c3
fix: error handler
fox-john Oct 7, 2024
c76d3b4
chore: update some var to global constant
fox-john Oct 7, 2024
a71e60c
fix: phpstan
fox-john Oct 7, 2024
7f1ba67
fix: php-cs-fixer
fox-john Oct 7, 2024
2f4f6c9
fix: error php
fox-john Oct 7, 2024
77d1e5c
fix: after review
fox-john Oct 9, 2024
130b441
docs: update readme
fox-john Oct 9, 2024
f18b0b3
fix: update header-stamps
fox-john Oct 10, 2024
0ac7cfa
fix: cut api
fox-john Oct 10, 2024
021f95d
fix: cut api
fox-john Oct 10, 2024
750e4f8
fix: php-cs-fixer
fox-john Oct 10, 2024
3c77ab5
fix: some problems after rework
fox-john Oct 10, 2024
47bf9a6
fix: bug
fox-john Oct 10, 2024
891bad5
fix: php-cs-fixer
fox-john Oct 10, 2024
026b1e1
fix: readme
fox-john Oct 10, 2024
a7a9fc1
refactor: set mytuns to docker
fox-john Oct 11, 2024
b5677ea
fix: service not found in 1.6
fox-john Oct 11, 2024
5e47b57
fix: repair compat 1.6 with accounts
fox-john Oct 11, 2024
43f7317
fix: readme after review
fox-john Oct 11, 2024
7bf799f
fix: php-stan and php-cs-fixer
fox-john Oct 11, 2024
151606a
fix: e2e test in 1.6
fox-john Oct 11, 2024
34ff384
fix: e2e test
fox-john Oct 16, 2024
832cbb2
fix: e2e lint
fox-john Oct 16, 2024
f97a802
chore: add comment
fox-john Oct 16, 2024
6569b42
chore: update dockerfile and ci with profiles
fox-john Oct 16, 2024
a6d4d89
fix: carrier details tests
fox-john Oct 16, 2024
cfc26f4
fix: e2e timeout
fox-john Oct 16, 2024
ef2e557
fix: docker e2e
fox-john Oct 17, 2024
92d096c
fix: init-scripts executable
fox-john Oct 17, 2024
dbcdbab
fix: V4 | revert order histories and bundles naming (#384)
fox-john Oct 22, 2024
47e9406
fix: deleted object v4 (#387)
fox-john Oct 31, 2024
f3e851a
fix: carrier details and taxes (#394)
fox-john Nov 19, 2024
4365a4b
Merge branch 'main' into feature/pseventbus-v4-base
fox-john Nov 20, 2024
9ee05e2
fix: carrier details and taxes (#395)
fox-john Nov 20, 2024
69b17b8
fix: unused var
fox-john Nov 20, 2024
bb941a0
fix: php-stan
fox-john Nov 20, 2024
07ffa00
fix: fixture 1.6
fox-john Nov 20, 2024
bc8be57
fix: fixture of another tests
fox-john Nov 20, 2024
db54956
fix: carrier details fixtures
fox-john Nov 20, 2024
42cc6f3
fix: carrier details fixtures
fox-john Nov 20, 2024
2a96218
fix: carrier details fixtures
fox-john Nov 21, 2024
0edc159
fix: 1.6 fixtures
fox-john Nov 21, 2024
ca51eee
fix: php-cs-fixer
fox-john Nov 21, 2024
8997124
fix: test for 9.0
fox-john Nov 21, 2024
92ef45f
fix: add product attribute shop content (#396)
fox-john Nov 25, 2024
e1b624e
fix: carriers
fox-john Nov 26, 2024
6824dbb
Merge branch 'feature/pseventbus-v4-base' of https://github.com/Prest…
fox-john Nov 26, 2024
9594985
fix: carriers fixtures
fox-john Nov 26, 2024
5dd6b62
fix: carriers fixtures²
fox-john Nov 26, 2024
aa4d64e
fix: missing hooks incremental
fox-john Nov 27, 2024
907c980
fix: some hooks
fox-john Nov 28, 2024
3533089
fix: e2e test v9
fox-john Nov 28, 2024
3e70bf9
fix: order cart rule types
fox-john Nov 28, 2024
43fe2d3
fix: lint js
fox-john Nov 28, 2024
333ea9d
fix: php-cs-fixer
fox-john Nov 28, 2024
0f967bd
Merge branch 'main' into feature/pseventbus-v4-base
fox-john Nov 28, 2024
fa184ee
fix: hook error for product create
fox-john Nov 29, 2024
cbc6b64
fix: deisalbe limit for all sub shop content for incremental sync
fox-john Nov 29, 2024
33475a2
fix: typo
fox-john Dec 2, 2024
bbb07b7
fix: readme and php-cs-fixer
fox-john Dec 2, 2024
330a2f0
fix: fixtrues
fox-john Dec 2, 2024
8c54ca7
fix: upgrade script lisibility
fox-john Dec 2, 2024
d8f8d42
fix: upgrade script bug
fox-john Dec 3, 2024
b2093e9
fix: rework upgrade script for max perfs
fox-john Dec 3, 2024
b50e3ad
fix: edit install script
fox-john Dec 3, 2024
9d17fd3
fix: reset info shop content naming
fox-john Dec 4, 2024
f54b645
fix: shop collection
fox-john Dec 4, 2024
6858b27
fix: bundles incremental
fox-john Dec 4, 2024
472e5e8
fix: info e2e
fox-john Dec 4, 2024
36f47dd
fix: bundles data repository
fox-john Dec 4, 2024
0269a4d
fix: e2e
fox-john Dec 4, 2024
fea852f
fix: error
fox-john Dec 4, 2024
76a5789
fix: php-cs-fixer
fox-john Dec 4, 2024
166111b
fix: bundles
fox-john Dec 4, 2024
485cccf
refactor: cut all hooks into traits
fox-john Dec 4, 2024
939157d
refactor: ordering of hooks
fox-john Dec 5, 2024
d223b5a
chore: disable problematic hook
fox-john Dec 5, 2024
f12a74d
fix: remove problematic hook
fox-john Dec 5, 2024
cb587ab
fix: order cart rule cast
fox-john Dec 5, 2024
50df87c
fix: product cast
fox-john Dec 5, 2024
9153f7c
fix: compat 1.6
fox-john Dec 5, 2024
3a6b031
fix: compat 1.6²
fox-john Dec 5, 2024
bca8b9d
fix: service container v9 (#397)
fox-john Dec 5, 2024
1b88f57
fix: php-cs-fixer and php-stan
fox-john Dec 5, 2024
ca12efc
Merge branch 'main' into feature/pseventbus-v4-base
fox-john Dec 5, 2024
64f2d03
fix: service container
fox-john Dec 5, 2024
7eaced1
fix: fictures
fox-john Dec 5, 2024
5ff87f9
fix: upgrade script bug with primary keys
fox-john Dec 6, 2024
7bdc003
fix: change comment to upgrade scripts
fox-john Dec 6, 2024
dd682ff
fix: service container has method check
fox-john Dec 6, 2024
cb3fbad
fix: incremental for employees
fox-john Dec 6, 2024
a44d616
fix: stocks
fox-john Dec 6, 2024
8b0f05b
fix: stock hooks
fox-john Dec 6, 2024
15f41fc
fix: cart rule var for 1.6
fox-john Dec 9, 2024
8559c29
fix: stocks available an d movements
fox-john Dec 9, 2024
14d9b47
fix: bundle to attributes
fox-john Dec 9, 2024
11ca9ce
fix: bug with zip and php-cs-fixer
fox-john Dec 10, 2024
36f17df
fix: makefile
fox-john Dec 10, 2024
3e6bacb
fix: php-stan
fox-john Dec 10, 2024
4109071
fix: stocks
fox-john Dec 10, 2024
f3f7dee
refactor: remove useless hooks and associated code
fox-john Dec 10, 2024
b2c7842
chore: update type of column id_object of incremental_sync table
fox-john Dec 10, 2024
245fc86
fix: product incremental
fox-john Dec 11, 2024
1f4e0b7
chore: upgrade max incremental sync table size
fox-john Dec 12, 2024
026cf36
chore: remove attribute shop content
fox-john Dec 12, 2024
c053c69
fix: refactor product declination data into incremental
fox-john Dec 12, 2024
968192f
fix: service container
fox-john Dec 12, 2024
b0e0bf4
fix: presenter with new service container
fox-john Dec 12, 2024
aa80647
fix: delete into incremental
fox-john Dec 13, 2024
0fa1b17
fix: php-cs-fixer and php-stan
fox-john Dec 13, 2024
a6664b2
fix: remove attribute from test e2e
fox-john Dec 13, 2024
1b5497a
fix: delete for combination
fox-john Dec 13, 2024
c3cca7b
fix: php-cs-fixer and php-stan
fox-john Dec 13, 2024
7271700
fix: client http in v9
fox-john Dec 13, 2024
1c8cccc
fix: common bug
fox-john Dec 16, 2024
ebf3fa6
fix: bug with combination
fox-john Dec 16, 2024
45b4572
fix: upgrade script when deleted_object is empty
fox-john Dec 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 27 additions & 0 deletions .config.inte.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <[email protected]>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/

return [
'ps_eventbus.proxy_api_url' => 'https://eventbus-proxy.psessentials-integration.net',
'ps_eventbus.sync_api_url' => 'https://eventbus-sync.psessentials-integration.net',
'ps_eventbus.live_sync_api_url' => 'https://api.cloudsync-integration.prestashop.com/live-sync/v1',
'ps_eventbus.sentry_dsn' => 'https://[email protected]/6066714',
'ps_eventbus.sentry_env' => 'integration',
];
6 changes: 0 additions & 6 deletions .config.inte.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .config.prod.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <[email protected]>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/

return [
'ps_eventbus.proxy_api_url' => 'https://eventbus-proxy.psessentials.net',
'ps_eventbus.sync_api_url' => 'https://eventbus-sync.psessentials.net',
'ps_eventbus.live_sync_api_url' => 'https://api.cloudsync.prestashop.com/live-sync/v1',
'ps_eventbus.sentry_dsn' => 'https://[email protected]/6066714',
'ps_eventbus.sentry_env' => 'production',
];
6 changes: 0 additions & 6 deletions .config.prod.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/build-release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
run: |
cp .env.dist .env
docker compose build
docker compose up --detach --wait
docker compose --profile cicd up --detach --wait
env:
DOCKER_IMAGE_PRESTASHOP: prestashop/prestashop-flashlight:${{matrix.ps_version}}
working-directory: e2e-env
Expand All @@ -74,7 +74,7 @@ jobs:
if: failure()
run: |
docker compose logs cloudsync-mock
docker compose down -v
docker compose --profile cicd down -v
working-directory: e2e-env

upload_release_assets:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/quality-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ jobs:
strategy:
fail-fast: false
matrix:
# @TODO: "1.6.1.24" is temporarily disabled here
ps_version: ["1.6.1.11", "1.7.8.10", "8.1.6"]
steps:
- name: Checkout
Expand Down Expand Up @@ -115,6 +114,9 @@ jobs:
path: vendor
key: php-${{ hashFiles('composer.lock') }}

- name: install php dependencies
run: composer install

- name: Install dependencies and setup e2e
run: pnpm install --no-optional --force
working-directory: e2e
Expand All @@ -123,7 +125,7 @@ jobs:
run: |
cp .env.dist .env
docker compose build
docker compose up --detach --wait
docker compose --profile cicd up --detach --wait
env:
DOCKER_IMAGE_PRESTASHOP: prestashop/prestashop-flashlight:${{matrix.ps_version}}
working-directory: e2e-env
Expand All @@ -136,7 +138,7 @@ jobs:
if: failure()
run: |
docker compose logs cloudsync-mock prestashop
docker compose down -v
docker compose --profile cicd down -v
working-directory: e2e-env

e2e-lint:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ e2e/dumps
sonar-project.properties

*.cache

### Mytuns
credentials.json
14 changes: 14 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Apache 2.2
<IfModule !mod_authz_core.c>
<Files *.php>
order allow,deny
deny from all
</Files>
</IfModule>

# Apache 2.4
<IfModule mod_authz_core.c>
<Files *.php>
Require all denied
</Files>
</IfModule>
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
->exclude('vendor');

$config = (new PrestaShop\CodingStandards\CsFixer\Config())
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
->setUsingCache(false)
->setFinder($finder);

Expand Down
2 changes: 2 additions & 0 deletions .zip-contents
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ src
upgrade
vendor
ps_eventbus.php
config.php
logo.png
config.xml
LICENSE
README.md
composer.json
composer.lock
.htaccess
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ zip: zip-prod zip-inte zip-e2e
# target: zip-e2e - Bundle a local E2E integrable zip
.PHONY: zip-e2e
zip-e2e: vendor tools/vendor dist
@$(call zip_it,./config/parameters.yml,${PACKAGE}_e2e.zip)
@$(call zip_it,./config.php,${PACKAGE}_e2e.zip)

# target: zip-inte - Bundle an integration zip
.PHONY: zip-inte
zip-inte: vendor tools/vendor dist
@$(call zip_it,.config.inte.yml,${PACKAGE}_integration.zip)
@$(call zip_it,.config.inte.php,${PACKAGE}_integration.zip)

# target: zip-prod - Bundle a production zip
.PHONY: zip-prod
zip-prod: vendor tools/vendor dist
@$(call zip_it,.config.prod.yml,${PACKAGE}.zip)
@$(call zip_it,.config.prod.php,${PACKAGE}.zip)

# target: zip-unzipped - Bundle a production module, but without zip step (only to check sources)
.PHONY: zip-unzipped
zip-unzipped: vendor tools/vendor dist
@$(call no_zip_it,.config.prod.yml)
@$(call no_zip_it,.config.prod.php)

dist:
@mkdir -p ./dist
Expand Down Expand Up @@ -151,9 +151,14 @@ docker-phpunit-cov: tools/vendor
.PHONY: phpstan docker-phpstan
phpstan: tools/vendor prestashop/prestashop-${PS_VERSION}
phpstan analyse --memory-limit=-1 --configuration=./tests/phpstan/phpstan-local.neon;
docker-phpstan:
docker-phpstan: tools/vendor
@$(call in_docker,/usr/bin/phpstan,analyse --memory-limit=-1 --configuration=./tests/phpstan/phpstan-docker.neon)

# target: header-stamp - check Headers of PHP files
.PHONY:header-stamp
header-stamp:
tools/vendor/bin/header-stamp --license=tools/vendor/prestashop/header-stamp/assets/osl3.txt --exclude=vendor,tools,e2e,e2e-env,tests,composer.json,scoper.inc.php

define COMMENT
Fixme: add "allure-framework/allure-phpunit" in composer.json to solve this.
Currently failing to resolve devDeps:
Expand All @@ -178,7 +183,8 @@ define create_module
cp -r $(shell cat .zip-contents) ${TMP_DIR}/${MODULE_NAME};
$(call replace_version,${TMP_DIR}/${MODULE_NAME},${SEM_VERSION})
./tools/vendor/bin/autoindex prestashop:add:index ${TMP_DIR}
cp $1 ${TMP_DIR}/${MODULE_NAME}/config/parameters.yml
tools/vendor/bin/header-stamp --target=${TMP_DIR}/${MODULE_NAME} --license=tools/vendor/prestashop/header-stamp/assets/osl3.txt --exclude=vendor,e2e,e2e-env,tests,composer.json,scoper.inc.php
cp $1 ${TMP_DIR}/${MODULE_NAME}/config.php
cd ${TMP_DIR}/${MODULE_NAME} && composer dump-autoload
endef

Expand Down
99 changes: 80 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,24 @@
## Compatibility matrix

| PrestaShop platform | PHP | PS EventBus |
| ------------------- | ---- | ----------- |
| 8.0 | 7.1+ | From 2.x |
| 1.7.3-1.7.8 | 7.1+ | From 2.x |
| 1.6.1.11 - 1.7.2.5 | 7.1 | From 3.1 |
| ------------------- | ---- | ----------------------- |
| 8.0 | 7.1+ | From 2.x - to latest |
| 1.7.3-1.7.8 | 7.1+ | From 2.x - to latest |
| 1.6.1.11 - 1.7.2.5 | 5.6+ | From 3.1 - to latest |

PS Accounts compatibility matrix [can be viewed here](https://github.com/PrestaShopCorp/ps_accounts#compatibility-matrix).

### Product Images Issue in PHP 8.1
#### Product Images Issue in PHP 8.1

Please note that starting from PHP 8.1, product images may be missing due to a known issue.
This is a recognized problem and is being tracked in the PrestaShop repository.
You can follow the progress and find more details about the resolution [here](https://github.com/PrestaShop/PrestaShop/issues/36836).

### BREAKING CHANGES

Since version 4.0, all API endpoints are grouped under a single controller "apiShopContent.php" (except for the healthcheck). The route to call is now unique, and the shopContent is no longer a specific endpoint but a query parameter of the request:
```http://localhost:8000/index.php?fc=module&module=ps_eventbus&controller=apiShopContent&shop_content=products```

## Use

```sh
Expand Down Expand Up @@ -99,22 +104,78 @@ Dev requirements:

Or an up-to-date [Docker engine](https://docs.docker.com/engine/install).

## List of missing data in a database and why is missing

| Object content | Reason | Added in PS version | Link with more info |
|:----------------------------------:|:--------------------:|:-------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| currency.precision | row missing in table | 1.7.6.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/37807f66b40b0cebb365ef952e919be15e9d6b2f#diff-3f41d3529ffdbfd1b994927eb91826a32a0560697025a734cf128a2c8e092a45R124) |
| employee.has_enabled_gravatar | row missing in table | 1.7.8.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/20f1d9fe8a03559dfa9d1f7109de1f70c99f1874#diff-cde6a9d4a58afb13ff068801ee09c0e712c5e90b0cbf5632a0cc965f15cb6802R107) |
| product.additional_delivery_time | row missing in table | 1.7.3.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/10268af8db4163dc2a02edb8da93d02f37f814d8#diff-e94a594ba740485c7a4882b333984d3932a2f99c0d6d0005620745087cce7a10R260) |
| product.delivery_in_stock | row missing in table | 1.7.3.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/10268af8db4163dc2a02edb8da93d02f37f814d8#diff-e94a594ba740485c7a4882b333984d3932a2f99c0d6d0005620745087cce7a10R260) |
| product.delivery_out_stock | row missing in table | 1.7.3.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/10268af8db4163dc2a02edb8da93d02f37f814d8#diff-e94a594ba740485c7a4882b333984d3932a2f99c0d6d0005620745087cce7a10R260) |
| stock.location | row missing in table | 1.7.5.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/4c7d58a905dfb61c7fb2ef4a1f9b4fab2a8d8ecb#diff-e57fb1deeaab9e9079505333394d58f0bf7bb40280b4382aad1278c08c73e2e8R58) |
| store_lang | table missing | 1.7.3.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/7dda2be62d8bd606edc269fa051c36ea68f81682#diff-e98d435095567c145b49744715fd575eaab7050328c211b33aa9a37158421ff4R2004) |
| wishlist¹ | table missing | n/a | [Prestashop Addons](https://addons.prestashop.com/en/undownloadable/9131-wishlist-block.html) |
| taxonomy² | table missing | n/a | [Prestashop Addons](https://addons.prestashop.com/fr/produits-sur-facebook-reseaux-sociaux/50291-prestashop-social-with-facebook-instagram.htmll) |
### How to add new shop content
Let's take the example of adding a shopContent named "plane".

Add the shop content in the [Config.php](src/Config/Config.php) file (create a constant, and add it to the SHOP_CONTENTS array).
```PHP
const COLLECTION_PLANES = 'planes';

const SHOP_CONTENTS = [
...
self::COLLECTION_PLANES
...
];
```

Create a service "planesService.php" (in plural) in the [shop content services folder](src/Service/ShopContent/) that extends the [ShopContentAbstractService](src/Service/ShopContent/ShopContentAbstractService.php) and implements the [ShopContentServiceInterface.php](src/Service/ShopContent/ShopContentServiceInterface.php) interface. For the method structure, use the existing base on all other shop content services to maintain consistency.
```PHP
class PlanesService extends ShopContentAbstractService implements ShopContentServiceInterface
{
...
}
```
_Don't missing to declare this new service to [service.yml](config/front/services.yml) file._

Then create a repository PlaneRepository.php (in singular) in the [Repository](src/Repository/) folder that extends the [AbstractRepository.php](src/Repository/AbstractRepository.php) class and implements the [RepositoryInterface.php](src/Repository/RepositoryInterface.php) interface. Similarly, maintain consistency with other shop content repositories.
fox-john marked this conversation as resolved.
Show resolved Hide resolved
```PHP
class PlaneRepository extends AbstractRepository implements RepositoryInterface
{
...
}
```
_Don't missing to declare this new repository to [repository.yml](config/common/repository.yml) file._

Add your shop content in the [e2e config file](e2e/src/helpers/shop-contents.ts).
```javascript
export const shopContentMapping = {
...
planes: 'planes'
...
}
```

Run the tests once to generate the necessary dumps (they will be present in the [dump](e2e/dumps/) folder). Once the test is performed (and failed), copy the planes.json file, and paste it into the fixture folder for your given version. Do the same for each version (if the versions return different results).

You can run the tests again and ensure everything is green.

In case your shopContent cannot return results (missing data in the tables), please add a planes.json file in the folders of each version containing an empty array.

### List of missing data in a database and why is missing

| Object content | Reason | Added in PS version | Link with more info |
|:----------------------------------:|:--------------------:|:-------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| currency.precision | row missing in table | 1.7.6.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/37807f66b40b0cebb365ef952e919be15e9d6b2f#diff-3f41d3529ffdbfd1b994927eb91826a32a0560697025a734cf128a2c8e092a45R124) |
| employee.has_enabled_gravatar | row missing in table | 1.7.8.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/20f1d9fe8a03559dfa9d1f7109de1f70c99f1874#diff-cde6a9d4a58afb13ff068801ee09c0e712c5e90b0cbf5632a0cc965f15cb6802R107) |
| product.additional_delivery_time | row missing in table | 1.7.3.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/10268af8db4163dc2a02edb8da93d02f37f814d8#diff-e94a594ba740485c7a4882b333984d3932a2f99c0d6d0005620745087cce7a10R260) |
| product.delivery_in_stock | row missing in table | 1.7.3.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/10268af8db4163dc2a02edb8da93d02f37f814d8#diff-e94a594ba740485c7a4882b333984d3932a2f99c0d6d0005620745087cce7a10R260) |
| product.delivery_out_stock | row missing in table | 1.7.3.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/10268af8db4163dc2a02edb8da93d02f37f814d8#diff-e94a594ba740485c7a4882b333984d3932a2f99c0d6d0005620745087cce7a10R260) |
| stock.location | row missing in table | 1.7.5.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/4c7d58a905dfb61c7fb2ef4a1f9b4fab2a8d8ecb#diff-e57fb1deeaab9e9079505333394d58f0bf7bb40280b4382aad1278c08c73e2e8R58) |
| store_lang | table missing | 1.7.3.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/7dda2be62d8bd606edc269fa051c36ea68f81682#diff-e98d435095567c145b49744715fd575eaab7050328c211b33aa9a37158421ff4R2004) |
| wishlist¹ | table missing | n/a | [Prestashop Addons](https://addons.prestashop.com/en/undownloadable/9131-wishlist-block.html) |
| taxonomy² | table missing | n/a | [Prestashop Addons](https://addons.prestashop.com/fr/produits-sur-facebook-reseaux-sociaux/50291-prestashop-social-with-facebook-instagram.htmll) |
| stock_available. physical_quantity | row missing in table | 1.7.2.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/2a3269ad93b1985f2615d6604458061d4989f0ea#diff-e98d435095567c145b49744715fd575eaab7050328c211b33aa9a37158421ff4R2186) |
| stock_available. reserved_quantity | row missing in table | 1.7.2.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/2a3269ad93b1985f2615d6604458061d4989f0ea#diff-e98d435095567c145b49744715fd575eaab7050328c211b33aa9a37158421ff4R2186) |
| languages.locale | row missing in table | 1.7.0.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/481111b8274ed005e1c4a8ce2cf2b3ebbeb9a270#diff-c123d3d30d9c9e012a826a21887fccce6600a2f2a848a58d5910e55f0f8f5093R41) |
| languages.locale | row missing in table | 1.7.0.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/481111b8274ed005e1c4a8ce2cf2b3ebbeb9a270#diff-c123d3d30d9c9e012a826a21887fccce6600a2f2a848a58d5910e55f0f8f5093R41) |
| products.mpn | row missing in table | 1.7.7.0 | [github](https://github.com/PrestaShop/PrestaShop/commit/75fcc335a85c4e3acb2444ef9584590a59fc2d62#diff-e98d435095567c145b49744715fd575eaab7050328c211b33aa9a37158421ff4R1615) |

¹ Feature enabled only with PsWishlist module</br>
² Feature enabled only with PsFacebook module

### Debugging
There are 3 variables that are passed globally from the apiShopContent file to the end of the chain (repositories and errorHandler):
- PS_EVENTBUS_EXPLAIN_SQL_ENABLED
- PS_EVENTBUS_VERBOSE_ENABLED
- PS_EVENTBUS_LOGS_ENABLED

These variables are defined via the PHP function define() and reused in the files mentioned above. The reason for this usage is to avoid having to pass these variables through the entire execution chain to retrieve them at the end of the chain (e.g., apiShopContent => frontService => shopContentService => shopContentRepository).
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading