Integrations DI refactor, remove Sellasist/Baselinker, fix product-edit encoding (0.263)

- New: Domain\Integrations\IntegrationsRepository + admin\Controllers\IntegrationsController (DI)
- Cleanup: removed all Sellasist and Baselinker integrations from entire project
- Fix: product-edit.php Polish characters (UTF-8/CP1250 double-encoding)
- Update: factory\Integrations as facade (Apilo + ShopPRO only)
- Tests: 212 tests, 577 assertions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-13 21:59:26 +01:00
parent b4559a5e74
commit 1303b17de4
51 changed files with 1166 additions and 2663 deletions

View File

@@ -260,12 +260,23 @@ grep -r "Product::getQuantity" .
- Legacy cleanup: usuniety `autoload/admin/controls/class.Users.php`
- Testy: 25 testow repozytorium (CRUD, logon, 2FA, checkLogin) + 12 testow kontrolera (kontrakty + normalizeUser)
- **Integrations** (migracja kontrolera i repozytorium + cleanup Sellasist/Baselinker)
- ✅ IntegrationsRepository - **ZMIGROWANE** (2026-02-13) 🎉
- Nowa klasa: `Domain\Integrations\IntegrationsRepository` (settings Apilo/ShopPRO, OAuth, product linking, API fetch)
- Nowy kontroler: `admin\Controllers\IntegrationsController` (DI, instancyjny)
- Router: `admin\Site` - factory wpis dla modulu `Integrations`
- Fasada: `admin\factory\Integrations` deleguje do repozytorium (tylko Apilo + ShopPRO)
- **CLEANUP:** usunieto integracje Sellasist i Baselinker z calego projektu
- Usuniete pliki: `controls/Integrations`, `controls/Baselinker`, `factory/Baselinker`, `front/factory/Shop`, `shop/ShopStatus`, szablony sellasist/baselinker
- Wyczyszczone referencje w: cron.php, Order, ShopStatuses, ShopTransport, ShopPaymentMethod, ShopProduct, config.php, front/factory/*
- Testy: 16 nowych testow (repozytorium) + 10 testow kontrolera
- Aktualizacja: ver. 0.263
### 📋 Do zrobienia
- Order
- Category
- ShopAttribute
- ShopProduct (factory)
- Pages (`browse_list` i widoki drzewiaste nadal w legacy `admin\controls` / `admin\view`)
## Testowanie
@@ -286,17 +297,19 @@ tests/
│ │ ├── Dictionaries/DictionariesRepositoryTest.php
│ │ ├── Product/ProductRepositoryTest.php
│ │ ├── Settings/SettingsRepositoryTest.php
│ │ ── User/UserRepositoryTest.php
│ │ ── User/UserRepositoryTest.php
│ │ └── Integrations/IntegrationsRepositoryTest.php
│ └── admin/
│ └── Controllers/
│ ├── ArticlesControllerTest.php
│ ├── DictionariesControllerTest.php
│ ├── IntegrationsControllerTest.php
│ ├── ProductArchiveControllerTest.php
│ ├── SettingsControllerTest.php
│ └── UsersControllerTest.php
└── Integration/
```
**Łącznie: 119 testów, 256 asercji**
**Łącznie: 212 testów, 577 asercji**
### Przykład testu
```php
@@ -381,10 +394,11 @@ vendor/bin/phpstan analyse autoload/Domain
6. **ProductArchive** ✅ (migracja kontrolera + cleanup szablonów, ver. 0.252)
7. **Filemanager** ✅ (migracja routingu + fix `Invalid Key`, ver. 0.252)
8. **Users** ✅ (repo + kontroler + 2FA + legacy cleanup, ver. 0.253)
9. **Order**
10. **Category**
11. **ShopAttribute**
12. **Pages** (`browse_list` i powiązane widoki nadal legacy)
9. **Pages** ✅ (repo + kontroler + drzewo stron + AJAX endpoints, ver. 0.262)
10. **Integrations** ✅ (repo + kontroler + cleanup Sellasist/Baselinker, ver. 0.263)
11. **Order**
12. **Category**
13. **ShopAttribute**
- **Form Edit System** - Nowy uniwersalny system formularzy edycji
- ✅ Klasy ViewModel: `FormFieldType`, `FormField`, `FormTab`, `FormAction`, `FormEditViewModel`
@@ -589,7 +603,7 @@ Gdy `persist = true`:
- **NOWE:** `admin\\Controllers\\LanguagesController` (DI) dla akcji `view_list/list`, `language_*`, `translation_*`
- **UPDATE:** `admin\\factory\\Languages` jako fasada delegujaca do repozytorium
- **CLEANUP:** usunieto legacy `admin\\controls\\Languages` oraz `admin\\view\\Languages`
- **UPDATE:** poprawki globalne `components/table-list` dla krotkich kolumn/filtr<74>w
- **UPDATE:** poprawki globalne `components/table-list` dla krotkich kolumn/filtr<74>w
## Aktualizacja 2026-02-12 (ver. 0.255)
- UPDATE: SettingsController, BannerController, DictionariesController, ArticlesController pobieraja liste jezykow przez Domain/Languages/LanguagesRepository (DI) zamiast legacy admin/factory/Languages.
@@ -700,3 +714,14 @@ Gdy `persist = true`:
- UPDATE: endpointy zalezne od Pages w innych modulach (`articles`, `layouts`, `shop-category`, `shop-product`) przepiete z `admin/ajax.php?a=*` na `/admin/pages/*`.
- CLEANUP: usuniete `autoload/admin/controls/class.Pages.php`, `autoload/admin/view/class.Pages.php`, `autoload/admin/factory/class.Pages.php`, `admin/ajax/pages.php`; `admin/ajax.php` nie includuje juz `ajax/pages.php`.
- Testy: **OK (186 tests, 478 assertions)**.
## Aktualizacja 2026-02-13 - Integrations (/admin/integrations)
- NOWE: `Domain\Integrations\IntegrationsRepository` (settings Apilo/ShopPRO, OAuth, product linking, API fetch lists, product search/create, ShopPRO import).
- NOWE: `admin\Controllers\IntegrationsController` (DI) dla akcji: `apilo_settings`, `apilo_settings_save`, `apilo_authorization`, `get_platform_list`, `get_status_types_list`, `get_carrier_account_list`, `get_payment_types_list`, `apilo_create_product`, `apilo_product_search`, `apilo_product_select_save`, `apilo_product_select_delete`, `shoppro_settings`, `shoppro_settings_save`, `shoppro_product_import`.
- UPDATE: `admin\factory\Integrations` jako fasada delegujaca do `Domain\Integrations\IntegrationsRepository` (tylko Apilo + ShopPRO).
- **CLEANUP: usunieto integracje Sellasist i Baselinker z calego projektu:**
- Usuniete klasy: `admin\controls\Integrations`, `admin\controls\Baselinker`, `admin\factory\Baselinker`, `front\factory\Shop`, `shop\ShopStatus`
- Usuniete szablony: `integrations/sellasist-settings.php`, `integrations/baselinker-settings.php`, `admin/templates/baselinker/`
- Wyczyszczone referencje w: `cron.php`, `cron/cron-xml.php`, `shop\Order`, `admin\controls\ShopStatuses`, `admin\controls\ShopTransport`, `admin\controls\ShopPaymentMethod`, `admin\controls\ShopProduct`, `admin\factory\ShopStatuses`, `admin\factory\ShopTransport`, `admin\factory\ShopProduct`, `front\factory\ShopStatuses`, `front\factory\ShopTransport`, `front\factory\ShopPaymentMethod`, `front\factory\ShopProduct`, `front\factory\ShopOrder`, `shop\Product`, `config.php`
- Wyczyszczone szablony: `shop-statuses/*`, `shop-transport/*`, `shop-payment-method/*`, `shop-product/*`, `site/main-layout.php`
- Testy: **OK (212 tests, 577 assertions)**.