SUMMARY.md with AC results, deviations, skill audit.
STATE.md updated: 5/6 plans complete, next → 06-05.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract private helpers to flatten 5-level nesting in AllegroIntegrationController
and ShopproIntegrationsController: loadAllegroDeliveryServices(),
fetchAllegroDeliveryResponse(), loadApaczkaServices().
sync() and saveStatusMappings() were already compliant from plan 06-06.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add IntegrationSources {ALLEGRO, SHOPPRO, APACZKA, INPOST} and RedirectPaths constants in src/Core/Constants/
- Replace integration source literals in AllegroOrderImportService, AllegroStatusSyncService, ShopproOrdersSyncService, ShopproPaymentStatusSyncService
- Replace redirect path literals in AllegroIntegrationController (24+ occurrences) and ShopproIntegrationsController (3 occurrences)
- Auto-fix: broken use statements from plan 06-01 in AllegroOrderImportService and AllegroIntegrationController (missing backslashes)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Phase 2 complete (4/4 plans):
- Plan 02-01: Fix dead ZPL page size condition in AllegroShipmentService
- Plan 02-02: Add time-based cursor to AllegroStatusSyncService
- Plan 02-03: Fix ShopproOrdersSyncService using wrong state repository
- Plan 02-04: Extract CronHandlerFactory as single cron composition point
Plan 02-04 specifics:
- New CronHandlerFactory builds complete cron object graph
- Application::maybeRunCronOnWeb() reduced from 80+ to ~20 lines
- bin/cron.php reduced from 123 to 26 lines
- Fixed 2 bugs: AllegroOAuthClient→AllegroTokenManager,
AllegroOrderSyncStateRepository→ShopproOrderSyncStateRepository
Co-Authored-By: Claude <noreply@anthropic.com>
Phase 02 plans 02-01, 02-02, 02-03:
- fix(02-01): dead condition in AllegroShipmentService ZPL page size
Both ternary branches returned 'A6'; ZPL now correctly returns 'ZPL'
- fix(02-02): add last_status_checked_at cursor to AllegroStatusSyncService
New migration adds orders.last_status_checked_at DATETIME NULL with
composite index (source, source_updated_at). findOrdersNeedingStatusSync()
filters by cursor; markOrderStatusChecked() records timestamp on success.
- fix(02-03): replace AllegroOrderSyncStateRepository in ShopproOrdersSyncService
New ShopproOrderSyncStateRepository (same table, correct class name).
Application.php wires correct repository to correct service.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Introduced ShipmentProviderInterface to define the contract for shipment providers.
- Implemented ShipmentProviderRegistry to manage and retrieve shipment providers.
- Added a new tool for probing Apaczka order_send payload variants, enhancing debugging capabilities.
- Implemented ShopproPaymentStatusSyncService to handle payment status synchronization between Shoppro and Orderpro.
- Added methods for resolving watched status codes, finding candidate orders, and syncing individual order payments.
- Introduced ShopproStatusMappingRepository for managing status mappings between Shoppro and Orderpro.
- Created ShopproStatusSyncService to facilitate synchronization of order statuses from Shoppro to Orderpro.
- Added a check for available InPost services and display a message if none are found.
- Updated the InPost service selection dropdown to include additional data attributes for better handling in JavaScript.
- Improved JavaScript event handling for InPost service selection to correctly populate hidden fields with selected service data.
feat: Introduce Cash on Delivery (COD) functionality in shipment preparation
- Added a new input field for specifying the COD amount and currency in the shipment preparation view.
- Updated the shipment creation logic to handle COD amounts correctly when creating shipments.
refactor: Update OrdersController to include shipment package repository
- Modified the OrdersController to accept a ShipmentPackageRepository for better management of shipment-related data.
- Enhanced order details to include shipment package information.
fix: Ensure internal order numbers are generated upon order creation
- Updated the OrderImportRepository to generate and store internal order numbers when a new order is created.
feat: Implement status synchronization for Allegro orders
- Introduced a new service for syncing order statuses from Allegro to the internal system.
- Added logic to fetch and process orders needing status updates, handling errors gracefully.
chore: Clean up InPost service definitions in AllegroIntegrationController
- Removed hardcoded InPost service definitions and replaced them with dynamic fetching based on available services.
feat: Add activity logging for shipment actions
- Implemented activity logging for various shipment actions, including creation, label downloads, and errors, to improve traceability and auditing.
- Implement AllegroShipmentService for managing shipment creation and status checks.
- Create ShipmentController to handle shipment preparation and label downloading.
- Introduce ShipmentPackageRepository for database interactions related to shipment packages.
- Add methods for retrieving delivery services, creating shipments, checking creation status, and downloading labels.
- Implement address validation and token management for Allegro API integration.
- Added AllegroOrderSyncStateRepository for managing sync state with Allegro orders.
- Introduced AllegroOrdersSyncService to handle the synchronization of orders from Allegro.
- Created AllegroStatusDiscoveryService to discover and store order statuses from Allegro.
- Developed AllegroStatusMappingRepository for managing status mappings between Allegro and OrderPro.
- Implemented AllegroStatusSyncService to facilitate status synchronization.
- Added CronSettingsController for managing cron job settings related to Allegro integration.
- Implemented OrdersRepository for handling order data with pagination, filtering, and sorting capabilities.
- Added methods for retrieving order status options, quick stats, and detailed order information.
- Created OrderStatusRepository for managing order status groups and statuses, including CRUD operations and sorting.
- Introduced a bootstrap file for test environment setup and autoloading.
- Refactored `listLinkedOffersByIntegration` to `paginateLinkedOffersByIntegration` in `MarketplaceRepository`.
- Added pagination support with `page` and `per_page` filters.
- Introduced sorting options for offers.
- Created `listOfferChannelsByIntegration` method to retrieve distinct sales channels.
- Enhanced SQL queries to support dynamic filtering based on provided parameters.
feat: Add new fields for products and SKU generation
- Introduced new fields: `new_to_date`, `additional_message`, `additional_message_required`, and `additional_message_text` in the `products` table.
- Added `findAllSkus` method in `ProductRepository` to retrieve all SKUs.
- Created `ProductSkuGenerator` class to handle SKU generation based on a configurable format.
- Implemented `nextSku` method to generate the next available SKU.
feat: Enhance product settings management in the UI
- Added new settings page for product SKU format in `SettingsController`.
- Implemented form handling for saving SKU format settings.
- Updated the view to include SKU format configuration options.
feat: Implement cron job for refreshing ShopPro offer titles
- Created `ShopProOfferTitlesRefreshHandler` to handle the cron job for refreshing offer titles.
- Integrated with the `OfferImportService` to import offers from ShopPro.
docs: Update database schema documentation
- Added documentation for new fields in the `products` table and new cron job for offer title refresh.
- Documented the purpose and structure of the `app_settings` table.
migrations: Add necessary migrations for new features
- Created migration to add `products_sku_format` setting in `app_settings`.
- Added migration to introduce new fields in the `products` table.
- Created migration for the new cron job schedule for refreshing ShopPro offer titles.
- Add ?ver=<filemtime> cache-busting to CSS/JS assets in app and auth layouts
- Use ?: 0 fallback on filemtime() to prevent E_WARNING when files are missing
- Escape security_information output with $e() to fix XSS vulnerability (show.php:91)
- Wrap product image metadata in __meta container, move storage path into <details>
- Add table--details CSS class and th { white-space: nowrap } rule
- Remove redundant sort, sort_dir, per_page filter dropdowns from users list
- Add 10 as a per-page option in users list
- Clean up completed items from TODO.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
shopPRO's products/update clears ALL language fields (name, description,
short_description, etc.) for any language not included in the payload.
Sending only {"categories":[...]} wiped them out.
saveProductCategoriesJson() now:
1. Looks up the local orderPRO product via findMappedProductId()
2. Loads per-integration translation (with global fallback)
3. Includes languages.pl in the payload alongside categories
Also adds ProductRepository to MarketplaceController constructor.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mapProductPayload() now receives the per-integration translation row for
the target integration. For name, short_description, and description it
uses the integration-specific value when set (non-null), and falls back
to the global product_translations value otherwise.
loadIntegrationTranslation() helper fetches the row from
product_integration_translations for the given product+integration pair.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add marketplace.fields.categories, marketplace.actions.assign_categories,
and marketplace.category_modal section with all modal UI strings.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add btn--sm class to assign-categories button
- Force DOM reflow in openModal() so CSS transition fires correctly
- Clear treeEl.innerHTML at start of renderTree() to prevent stale tree
on rapid double-click (race between two parallel fetch pairs)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>