ver. 0.292: ShopProduct + ShopPaymentMethod + ShopPromotion + ShopStatuses + ShopTransport frontend migration to Domain

Full migration of front\factory\ — entire directory removed (all 20 classes migrated).
ProductRepository +20 frontend methods, PromotionRepository +5 applyType methods,
TransportRepository +4 cached methods, PaymentMethodRepository +cached frontend methods.
Fix: broken transports_list() in ajax.php replaced with forPaymentMethod().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-17 21:55:16 +01:00
parent 827b903e1e
commit 89d9e61bec
48 changed files with 1780 additions and 975 deletions

View File

@@ -17,27 +17,27 @@ Panel administratora (33 moduły) został w pełni zmigrowany na architekturę D
| ShopBasket | ZMIGROWANY do `front\Controllers\ShopBasketController` | Operacje koszyka, add/remove/quantity, checkout |
| ShopClient | ZMIGROWANY do `front\Controllers\ShopClientController` | Logowanie, rejestracja, odzyskiwanie hasla, adresy, zamowienia |
| ShopOrder | ZMIGROWANY do `front\Controllers\ShopOrderController` | Webhooki płatności + order details |
| ShopProduct | Fasada | lazy_loading, warehouse_message, draw_product_attributes |
| ShopProduct | ZMIGROWANY — usunięty | logika w ProductRepository + szablony |
| ShopProducer | ZMIGROWANY do `front\Controllers\ShopProducerController` | list(), products() |
| ShopCoupon | ZMIGROWANY do `front\Controllers\ShopCouponController` | use_coupon(), delete_coupon() |
| Newsletter | ZMIGROWANY do `front\Controllers\NewsletterController` | signin(), confirm(), unsubscribe() |
### front/factory/ (20 klas — pobieranie danych + logika)
### ~~front/factory/~~ (20 klas — USUNIĘTY w ver. 0.292, wszystkie zmigrowane do Domain)
| Klasa | Status | Priorytet migracji |
|-------|--------|--------------------|
| ShopProduct | ORYGINALNA LOGIKA (~370 linii) | KRYTYCZNY — product_details(), promoted/top/new products |
| ShopProduct | ZMIGROWANA do `ProductRepository` — usunięta | — |
| ShopOrder | ZMIGROWANA do `OrderRepository` — usunięta | — |
| ShopClient | ZMIGROWANA do `ClientRepository` + `ShopClientController` — usunięta | — |
| ShopCategory | ZMIGROWANA do `CategoryRepository` — usunięta | — |
| Articles | ORYGINALNA LOGIKA | WYSOKI — złożone SQL z language fallback |
| ShopPromotion | ORYGINALNA LOGIKA | WYSOKI — silnik promocji (5 typów) |
| Articles | ZMIGROWANA do `ArticleRepository` — usunięta | — |
| ShopPromotion | ZMIGROWANA do `PromotionRepository` — usunięta | — |
| ShopBasket | ZMIGROWANA do `Domain\Basket\BasketCalculator` — usunięta | — |
| ShopTransport | CZĘŚCIOWO zmigrowana | ŚREDNI — transport_methods z filtrowaniem |
| ShopPaymentMethod | ZMIGROWANA (Domain) | — |
| ShopStatuses | ZMIGROWANA (Domain) | — |
| ShopTransport | ZMIGROWANA do `TransportRepository` — usunięta | — |
| ShopPaymentMethod | ZMIGROWANA do `PaymentMethodRepository` — usunięta | — |
| ShopStatuses | ZMIGROWANA do `ShopStatusRepository` — usunięta | — |
| Scontainers | ZMIGROWANA (Domain) — usunięta | — |
| Newsletter | ZMIGROWANA (Domain) — usunięta | — |
| Settings | Fasada (BUG: get_single_settings_value ignoruje $param) | NISKI |
| Settings | ZMIGROWANA do `SettingsRepository` — usunięta | — |
| Languages | USUNIĘTA — przepięta na Domain | — |
| Layouts | USUNIETA — przepieta na Domain | — |
| Banners | USUNIETA — przepieta na Domain | — |
@@ -58,8 +58,8 @@ Panel administratora (33 moduły) został w pełni zmigrowany na architekturę D
| Languages, Newsletter | PRZENIESIONE do `front\Views\` (nowy namespace) |
| ShopClient | PRZENIESIONA do `front\Views\ShopClient` |
| ShopOrder | ZMIGROWANA do `ShopOrderController` — usunięta |
| ShopPaymentMethod | Czyste VIEW |
| ShopTransport | PUSTA klasa (placeholder) |
| ShopPaymentMethod | USUNIĘTA (pusta klasa) |
| ShopTransport | USUNIĘTA (pusta klasa) |
### shop/ (14 klas — encje biznesowe)
| Klasa | Linii | Status | Priorytet |
@@ -72,7 +72,7 @@ Panel administratora (33 moduły) został w pełni zmigrowany na architekturę D
| Search | ~80 | NISKI — wrapper na szablony | NISKI |
| Coupon | ~60 | NISKI — niekompletne metody | NISKI |
| Transport | ~30 | NISKI — transport_list() | NISKI |
| PaymentMethod | — | ZMIGROWANA (fasada do Domain) | — |
| PaymentMethod | — | USUNIETA — callery na PaymentMethodRepository | — |
| Producer | — | USUNIETA (callery na ProducerRepository) | — |
| ProductSet | — | ZMIGROWANA (fasada do Domain) | — |
| ProductAttribute | ~100 | OK — dobry caching | — |
@@ -114,7 +114,7 @@ articles(8), banner(2), controls(1), menu(4), newsletter(2), scontainers(1), sho
## Znane bugi do naprawy podczas refaktoringu
1. ~~**KRYTYCZNY** `front\factory\ShopClient::login()` — hardcoded password bypass `'Legia1916'`~~ **NAPRAWIONE**`ClientRepository::authenticate()` bez bypass
2. `front\factory\Settings::get_single_settings_value()` — ignoruje `$param`, zawsze zwraca `firm_name`
2. ~~`front\factory\Settings::get_single_settings_value()` — ignoruje `$param`, zawsze zwraca `firm_name`~~ **NAPRAWIONE** — klasa usunięta, `SettingsRepository::getSingleValue()` z poprawnym `$param`
3. ~~`front\factory\Newsletter::newsletter_unsubscribe()` — błędna składnia SQL w delete~~ **NAPRAWIONE**`NewsletterRepository::unsubscribe()` z poprawną składnią medoo `delete()`
4. ~~`cms\Layout::__get()` — referuje nieistniejące `$this->data`~~ **NAPRAWIONE** — klasa usunięta, zastąpiona przez `$layoutsRepo->find()`
5. `shop\Search` — typo w use: `shop\Produt` (brak 'c')