Phase 50 complete:
- add conditional waybill push for allegro orders only
- add retry on ALLEGRO_HTTP_401 and non-critical failure handling
- add unit tests and update architecture/changelog docs
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.
- 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.