ver. 0.294: Remove all 12 legacy autoload/shop/ classes (~2363 lines)

Complete Domain-Driven Architecture migration:
- Phase 1-4: Transport, ProductSet, Coupon, Shop, Search, Basket,
  ProductCustomField, Category, ProductAttribute, Promotion
- Phase 5: Order (~562 lines) + Product (~952 lines)
- ~20 Product methods migrated to ProductRepository
- Apilo sync migrated to OrderAdminService
- Production hotfixes: stale Redis cache (prices 0.00), unqualified
  Product:: refs in LayoutEngine, object->array template conversion
- AttributeRepository::getAttributeValueById() Redis cache added

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-18 02:05:39 +01:00
parent 22530df501
commit 69e78ca248
74 changed files with 2176 additions and 2669 deletions

View File

@@ -4,6 +4,35 @@ Logi zmian z migracji na Domain-Driven Architecture. Najnowsze na gorze.
---
## ver. 0.294 (2026-02-18) - Usuniecie autoload/shop/ — 12 legacy klas
- **Faza 5.1: class.Order.php (~562 linii) USUNIETA**
- Logika Apilo sync przeniesiona do `OrderAdminService::processApiloSyncQueue()`
- Email zmiany statusu zintegrowany w `OrderAdminService::changeStatus()`
- `cron.php` przepiety na `OrderAdminService`
- `front\Controllers\ShopOrderController` — dodano `OrderAdminService` jako drugie DI
- `\shop\Order::order_statuses()``OrderRepository::orderStatuses()` (3 lokalizacje)
- **Faza 5.2: class.Product.php (~952 linii) USUNIETA — NAJWIEKSZA KLASA**
- ~20 metod przeniesionych do `ProductRepository`: `findCached()`, `isProductOnPromotion()`, `productSetsWhenAddToBasket()`, `addVisit()`, `getProductImg()`, `getProductUrl()`, `searchProductsByName()`, `searchProductByNameAjax()`, `searchProductsByNameCount()`, `isStock0Buy()`, `getProductPermutationQuantityOptions()`, `getProductIdByAttributes()`, `getProductPermutationHash()`, `getProductAttributes()`, `generateSkuCode()`, `productMeta()`, `generateSubtitleFromAttributes()`, `getDefaultCombinationPrices()`, `getProductDataBySelectedAttributes()`, `productCategories()`, `arrayCartesian()`
- `calculate_basket_product_price()` przeniesione do `BasketCalculator::calculateBasketProductPrice()`
- `BasketCalculator` przepisany: `summaryPrice()`, `checkProductQuantityInStock()` uzywaja `ProductRepository`
- XML generation (4 metody) — konwersja object→array access
- ~60+ callsite'ow zamienionych w kontrolerach, szablonach, repozytoriach i entry-pointach
- Cache key strings zaktualizowane z `\shop\Product::` na `ProductRepository::`
- **Cleanup:**
- Usunieto dead `\shop\` routing z `front\App::route()`
- Cache key `\shop\Promotion::get_active_promotions``PromotionRepository::getActivePromotions`
- Katalog `autoload/shop/` jest teraz pusty
- **Production hotfixes:**
- FIX: `findCached()` — stale Redis cache z obiektami `\shop\Product` powodowal ceny 0,00 zl (obiekty `__PHP_Incomplete_Class` po `(array)` cast maja zmanglowane klucze). Teraz invaliduje stary cache i re-fetchuje z DB
- FIX: `LayoutEngine.php` — 4 niekwalifikowane `Product::getFromCache()` resolwaly do `\front\Product` po usunieciu `use shop\Product`
- FIX: szablony (product-mini, product-search, product, product-warehouse-message, alert-product-sets, basket-details, main-view, promoted-products) — konwersja object access (`$product->field`) na array access (`$product['field']`)
- UPDATE: `AttributeRepository::getAttributeValueById()` — dodano Redis cache (zgodnosc ze starym `\shop\ProductAttribute::get_value_name()`)
- **PODSUMOWANIE CALEJ MIGRACJI:** 12 legacy klas, ~2363 linii kodu usunieto. Zero referencji `\shop\` w aktywnym kodzie.
- Testy: 610 OK, 1817 asercji
---
## ver. 0.293 (2026-02-17) - front\controls\Site + front\view\Site → front\App + front\LayoutEngine
- **front\controls\Site → front\App** — migracja routera na nowy namespace