ver. 0.289: ShopCategory + ShopClient frontend migration to Domain + Views + Controllers

ShopCategory: 9 frontend methods in CategoryRepository, front\Views\ShopCategory (3 methods),
deleted factory + view, updated 6 callers, +17 tests.

ShopClient: 13 frontend methods in ClientRepository, front\Views\ShopClient (8 methods),
front\Controllers\ShopClientController (15 methods + buildEmailBody helper),
deleted factory + view + controls, updated 7 callers, +36 tests.

Security fix: removed hardcoded password bypass 'Legia1916'.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-17 10:41:40 +01:00
parent 437d4c78dc
commit d29d396197
34 changed files with 2049 additions and 961 deletions

View File

@@ -108,8 +108,8 @@ shopPRO/
│ │ ├── Helpers/ # Helpers (ex class.S.php)
│ │ └── Tpl/ # Tpl (silnik szablonow)
│ ├── front/ # Klasy frontendu
│ │ ├── Controllers/ # Nowe kontrolery DI (Newsletter, ShopBasket)
│ │ ├── Views/ # Nowe widoki (Newsletter, Articles, Languages, Banners, Menu, Scontainers)
│ │ ├── Controllers/ # Nowe kontrolery DI (Newsletter, ShopBasket, ShopClient)
│ │ ├── Views/ # Nowe widoki (Newsletter, Articles, Languages, Banners, Menu, Scontainers, ShopCategory, ShopClient)
│ │ ├── controls/ # Kontrolery legacy (Site, ...)
│ │ ├── view/ # Widoki legacy (Site, ...)
│ │ └── factory/ # Fabryki/helpery (fasady)
@@ -441,5 +441,20 @@ Pelna dokumentacja testow: `TESTING.md`
- FIX: `libraries/thumb.php` — require przepiety na `Shared/Image/ImageManipulator.php`, poprawiony short open tag.
- FIX: `Tpl::render()` branch 3 — sprawdzal `../templates_user/` ale ladowal `../templates/`.
## Aktualizacja 2026-02-17 (ver. 0.289) - ShopCategory + ShopClient frontend migration
- **ShopCategory (frontend)** — migracja factory + view na Domain + Views
- NOWE METODY w `CategoryRepository`: `getCategorySort()`, `categoryName()`, `categoryUrl()`, `frontCategoryDetails()`, `categoriesTree()`, `blogCategoryProducts()`, `categoryProductsCount()`, `productsId()`, `paginatedCategoryProducts()` — z Redis cache, language fallback SQL, stale zamiast magic numbers
- NOWY: `front\Views\ShopCategory` — czysty VIEW (`categoryDescription()`, `categoryView()`, `categories()`)
- USUNIETA: `front\factory\class.ShopCategory.php` — logika przeniesiona do `CategoryRepository`
- USUNIETA: `front\view\class.ShopCategory.php` — zastapiona przez `front\Views\ShopCategory`
- **ShopClient (frontend)** — migracja factory + view + controls na Domain + Views + Controllers
- NOWE METODY w `ClientRepository`: `clientDetails()`, `clientEmail()`, `clientAddresses()`, `addressDetails()`, `addressDelete()`, `addressSave()`, `markAddressAsCurrent()`, `clientOrders()`, `authenticate()`, `createClient()`, `confirmRegistration()`, `generateNewPassword()`, `initiatePasswordRecovery()`
- NOWY: `front\Views\ShopClient` — czysty VIEW (8 metod camelCase)
- NOWY: `front\Controllers\ShopClientController` — instancyjny kontroler z DI (15 metod + `buildEmailBody()` helper)
- USUNIETA: `front\factory\class.ShopClient.php`, `front\view\class.ShopClient.php`, `front\controls\class.ShopClient.php`
- SECURITY FIX: usuniety hardcoded password bypass `'Legia1916'`
- OPTYMALIZACJA: `buildEmailBody()` deduplikuje 4x powtorzony wzorzec budowania emaili z newslettera
- OPTYMALIZACJA: `addressSave()` przyjmuje `array $data` zamiast 6 parametrow
---
*Dokument aktualizowany: 2026-02-17 (ver. 0.286)*
*Dokument aktualizowany: 2026-02-17 (ver. 0.289)*