Files
orderPRO/.paul/phases/66-allegro-delivery-tracking/66-01-SUMMARY.md
2026-04-03 22:35:49 +02:00

3.4 KiB

phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, duration, started, completed
phase plan subsystem tags requires provides affects tech-stack key-files key-decisions patterns-established duration started completed
66-allegro-delivery-tracking 01 shipments
allegro
tracking
edge-api
delivery-status
cron
phase provides
27-shipment-tracking-backend ShipmentTrackingInterface, DeliveryStatus, ShipmentTrackingHandler
Allegro Delivery tracking via edge.allegro.pl API
Edge API integration (no auth, public endpoint)
Rate limiting for edge API requests (60s)
allegro-tracking
delivery-status
cron-handler
added patterns
edge-api-integration
rate-limited-cron
created modified
src/Modules/Shipments/AllegroTrackingService.php
src/Modules/Shipments/DeliveryStatus.php
src/Modules/Cron/ShipmentTrackingHandler.php
Edge API (edge.allegro.pl/ad/tracking) zamiast Allegro REST API (nie daje tracking statusów)
Accept: application/vnd.allegro.internal.v1+json — wymagany nagłówek
Provider allegro_edge osobny od allegro_wza w DeliveryStatus
Rate limit 60s między requestami do edge API
slugifyAllegroDescription() konwertuje opisy PL na slugi mapowalne na statusy
Osobna metoda edgeApiRequest() bez Bearer token (publiczny endpoint)
~15min 2026-04-03T20:30:00Z 2026-04-03T20:45:00Z

Phase 66 Plan 01: Allegro Delivery Tracking — Core Integration

Integracja śledzenia przesyłek Allegro Delivery przez publiczne edge API — fetchAllegroEdgeStatus, mapowanie opisów PL na znormalizowane statusy, rate limiting 60s w cronie.

Performance

Metric Value
Duration ~15min
Tasks 3 completed (delegated)
Files modified 3
Execution mode Delegated auto (3 sub-agents)

Acceptance Criteria Results

Criterion Status Notes
AC-1: Allegro Delivery tracking zwraca status Pass fetchAllegroEdgeStatus pobiera z edge API
AC-2: Mapowanie opisów na statusy Pass slugify + ALLEGRO_EDGE_MAP
AC-3: Rate limiting max 1 req/min Pass sleep() w ShipmentTrackingHandler
AC-4: Fallback InPost nadal działa Pass Warunek carrier_id inpost/paczkomat bez zmian

Accomplishments

  • AllegroTrackingService pobiera statusy z edge.allegro.pl/ad/tracking dla non-InPost przesyłek
  • DeliveryStatus ma provider 'allegro_edge' z mapą slugów i opisów PL
  • ShipmentTrackingHandler throttluje requesty do edge API (60s)

Files Created/Modified

File Change Purpose
src/Modules/Shipments/DeliveryStatus.php Modified ALLEGRO_EDGE_MAP, ALLEGRO_EDGE_DESCRIPTIONS, slugifyAllegroDescription()
src/Modules/Shipments/AllegroTrackingService.php Modified fetchAllegroEdgeStatus(), edgeApiRequest()
src/Modules/Cron/ShipmentTrackingHandler.php Modified Rate limiting 60s dla allegro_wza non-inpost

Deviations from Plan

Auto-fixed Issues

1. Slug mismatch w mapie

  • Found during: Orkiestrator verification
  • Issue: "Kurier przekazał przesyłkę do magazynu" → slug przekazal_przesylke_do_magazynu nie był w mapie (była przekazana_do_magazynu)
  • Fix: Dodano wariant do ALLEGRO_EDGE_MAP
  • Verification: Test 5/5 realnych opisów mapuje poprawnie

Next Phase Readiness

Ready: Plan 66-02 rozszerza mapę i dodaje keyword fallback


Phase: 66-allegro-delivery-tracking, Plan: 01 Completed: 2026-04-03