Skip to content

Commit

Permalink
feat: fpseventbus v4 themes (#372)
Browse files Browse the repository at this point in the history
  • Loading branch information
fox-john authored Sep 26, 2024
1 parent 76111af commit 0495b5a
Show file tree
Hide file tree
Showing 11 changed files with 197 additions and 130 deletions.
6 changes: 0 additions & 6 deletions config/common/repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ services:
arguments:
- '@=service("prestashop.adapter.legacy.context").getContext()'

PrestaShop\Module\PsEventbus\Repository\ThemeRepository:
class: PrestaShop\Module\PsEventbus\Repository\ThemeRepository
public: true
arguments:
- '@=service("prestashop.adapter.legacy.context").getContext()'

PrestaShop\Module\PsEventbus\Repository\GoogleTaxonomyRepository:
class: PrestaShop\Module\PsEventbus\Repository\GoogleTaxonomyRepository
public: true
Expand Down
52 changes: 29 additions & 23 deletions config/front/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,70 +58,70 @@ services:

# SHOP CONTENT SERVICES
PrestaShop\Module\PsEventbus\Service\ShopContent\OrdersService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\OrdersService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\OrdersService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\OrderRepository'
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\OrderHistoryRepository'
- '@PrestaShop\Module\PsEventbus\Formatter\ArrayFormatter'

PrestaShop\Module\PsEventbus\Service\ShopContent\OrderCartRulesService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\OrderCartRulesService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\OrderCartRulesService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\OrderCartRuleRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\OrderHistoriesService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\OrderHistoriesService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\OrderHistoriesService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\OrderHistoryRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\OrderDetailsService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\OrderDetailsService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\OrderDetailsService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\OrderDetailRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\CarriersService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\CarriersService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\CarriersService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\CarrierRepository'
- '@PrestaShop\Module\PsEventbus\Repository\ConfigurationRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\CarrierDetailsService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\CarrierDetailsService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\CarrierDetailsService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\CarrierRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\CarrierTaxesService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\CarrierTaxesService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\CarrierTaxesService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\CarrierRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\CartsService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\CartsService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\CartsService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\CartRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\CartProductsService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\CartProductsService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\CartProductsService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\CartProductRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\CartRulesService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\CartRulesService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\CartRulesService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\CartRuleRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\ProductsService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\ProductsService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\ProductsService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\ProductRepository'
Expand All @@ -130,61 +130,61 @@ services:
- '@PrestaShop\Module\PsEventbus\Formatter\ArrayFormatter'

PrestaShop\Module\PsEventbus\Service\ShopContent\ProductBundlesService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\ProductBundlesService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\ProductBundlesService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\ProductBundleRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\ProductSuppliersService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\ProductSuppliersService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\ProductSuppliersService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\ProductSupplierRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\ProductCarriersService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\ProductCarriersService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\ProductCarriersService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\ProductCarrierRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\CategoriesService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\CategoriesService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\CategoriesService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\CategoryRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\CustomersService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\CustomersService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\CustomersService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\CustomerRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\CurrenciesService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\CurrenciesService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\CurrenciesService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\CurrencyRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\EmployeesService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\EmployeesService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\EmployeesService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\EmployeeRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\ImagesService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\ImagesService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\ImagesService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\ImageRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\ImageTypesService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\ImageTypesService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\ImageTypesService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\ImageTypeRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\ShopInformationService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\ShopInformationService
PrestaShop\Module\PsEventbus\Service\ShopContent\ShopDetailsService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\ShopDetailsService
public: true
arguments:
- '@=service("prestashop.adapter.legacy.context").getContext()'
Expand All @@ -194,8 +194,14 @@ services:
- '@PrestaShop\Module\PsEventbus\Service\ShopContent\CurrenciesService'

PrestaShop\Module\PsEventbus\Service\ShopContent\ModulesService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\ModulesService
class: PrestaShop\Module\PsEventbus\Service\ShopContent\ModulesService
public: true
arguments:
- '@PrestaShop\Module\PsEventbus\Repository\NewRepository\ModuleRepository'
- '@PrestaShop\Module\PsEventbus\Repository\ShopRepository'

PrestaShop\Module\PsEventbus\Service\ShopContent\ThemesService:
class: PrestaShop\Module\PsEventbus\Service\ShopContent\ThemesService
public: true
arguments:
- '@=service("prestashop.adapter.legacy.context").getContext()'
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"id": "1",
"collection": "shop_informations",
"collection": "shop_details",
"properties": {
"created_at": "2024-07-16 15:33:52",
"folder_created_at": "2024-07-16 15:34:17",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"id": "1",
"collection": "shop_informations",
"collection": "shop_details",
"properties": {
"created_at": "2023-12-20 22:56:03",
"folder_created_at": "2024-03-05 12:59:12",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"id": "1",
"collection": "shop_informations",
"collection": "shop_details",
"properties": {
"created_at": "2024-08-22T12:27:09+0200",
"folder_created_at": "2024-08-27T10:07:19+0200",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"id": "1",
"collection": "shop_informations",
"collection": "shop_details",
"properties": {
"created_at": "2024-06-10 02:27:21",
"folder_created_at": "2024-06-10 18:01:29",
Expand Down
3 changes: 2 additions & 1 deletion e2e/src/helpers/shop-contents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ export const shopContentMapping = {
employees: "employees",
images: "images",
image_types: "image-types",
shop_informations: "shops-informations",
shop_details: "shop-details",
modules: "modules",
themes: "themes",
} as const;

type ShopContentMapping = typeof shopContentMapping;
Expand Down
5 changes: 2 additions & 3 deletions src/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class Config
const COLLECTION_HEALTHCHECK = 'healthcheck';
const COLLECTION_IMAGES = 'images';
const COLLECTION_IMAGE_TYPES = 'image_types';
const COLLECTION_INFO = 'info';
const COLLECTION_LANGUAGES = 'languages';
const COLLECTION_MANUFACTURERS = 'manufacturers';
const COLLECTION_MODULES = 'modules';
Expand All @@ -59,7 +58,7 @@ class Config
const COLLECTION_PRODUCT_BUNDLES = 'product_bundles';
const COLLECTION_PRODUCT_CARRIERS = 'product_carriers';
const COLLECTION_PRODUCT_SUPPLIERS = 'product_suppliers';
const COLLECTION_SHOP_INFORMATIONS = 'shop_informations';
const COLLECTION_SHOP_DETAILS = 'shop_details';
const COLLECTION_SPECIFIC_PRICES = 'specific_prices';
const COLLECTION_STOCKS = 'stocks';
const COLLECTION_STOCK_MVTS = 'stock_movements';
Expand Down Expand Up @@ -97,7 +96,7 @@ class Config
self::COLLECTION_PRODUCT_BUNDLES,
self::COLLECTION_PRODUCT_CARRIERS,
self::COLLECTION_PRODUCT_SUPPLIERS,
self::COLLECTION_SHOP_INFORMATIONS,
self::COLLECTION_SHOP_DETAILS,
self::COLLECTION_SPECIFIC_PRICES,
self::COLLECTION_STOCKS,
self::COLLECTION_STOCK_MVTS,
Expand Down
91 changes: 0 additions & 91 deletions src/Repository/ThemeRepository.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use PrestaShop\Module\PsEventbus\Repository\LanguageRepository;
use PrestaShop\Module\PsEventbus\Repository\ShopRepository;

class ShopInformationService implements ShopContentServiceInterface
class ShopDetailsService implements ShopContentServiceInterface
{
/** @var CurrenciesService */
private $currenciesService;
Expand Down Expand Up @@ -75,7 +75,7 @@ public function getContentsForFull($offset, $limit, $langIso, $debug)
return [
[
'id' => '1',
'collection' => Config::COLLECTION_SHOP_INFORMATION,
'collection' => Config::COLLECTION_SHOP_DETAILS,
'properties' => [
'created_at' => $this->shopRepository->getCreatedAt(),
'folder_created_at' => $folderCreatedAt,
Expand Down
Loading

0 comments on commit 0495b5a

Please sign in to comment.