---
phase: 69-allegro-tracking-english-statuses
plan: 01
subsystem: shipments
tags: [allegro, tracking, edge-api, status-mapping, hotfix]

requires:
  - phase: 66-allegro-delivery-tracking
    provides: AllegroTrackingService edge API flow

provides:
  - EN status mapping for Allegro edge descriptions
  - EN keyword fallback in DeliveryStatus guesser
  - Unit tests for DeliveryStatus EN/PL normalization

affects: [allegro-tracking, delivery-status, docs]

key-files:
  modified:
    - src/Modules/Shipments/DeliveryStatus.php
    - DOCS/DB_SCHEMA.md
    - DOCS/ARCHITECTURE.md
    - DOCS/TECH_CHANGELOG.md
  created:
    - tests/Unit/DeliveryStatusTest.php
---

# Phase 69 Plan 01: Allegro Tracking English Statuses

Naprawiono przypadki, w ktorych statusy Allegro edge API w jezyku angielskim byly zapisywane jako `unknown`.

## Outcome
- `DeliveryStatus::slugifyAllegroDescription()` obsluguje prefiksy EN (`Parcel has been ...`, `Parcel is ...`, `Courier has ...`).
- `ALLEGRO_EDGE_MAP` rozszerzono o slugi EN (m.in. `awaiting_pick_up`, `delivered`, `dispatched`, `released_for_delivery`).
- `guessStatusFromDescription()` rozszerzono o fallback EN.
- Dodano testy jednostkowe `DeliveryStatusTest` (4 testy, 7 asercji).

## Verification
- `php -l src/Modules/Shipments/DeliveryStatus.php` -> OK.
- `phpunit --filter DeliveryStatusTest` -> OK (4/4).
- Realny numer `A0046XFMG1`:
  - `description=Parcel is awaiting pick-up`
  - `slug=awaiting_pick_up`
  - `normalized=ready_for_pickup`

## Notes
- Zmiana nie wymaga migracji DB.
- Zaktualizowano dokumentacje techniczna (`DB_SCHEMA`, `ARCHITECTURE`, `TECH_CHANGELOG`).
