Skip to content

fix(delivery): EcoTrack DHD dispatch - preserve POST through host redirects and fill required adresse - #126

Open
salahzidi wants to merge 1 commit into
bighadj22:mainfrom
salahzidi:fix/ecotrack-dhd-dispatch
Open

salahzidi wants to merge 1 commit into
bighadj22:mainfrom
salahzidi:fix/ecotrack-dhd-dispatch

Conversation

@salahzidi

Copy link
Copy Markdown

Problem 1 - dispatch 405 'GET method not supported'
dhd.ecotrack.dz answers HTTP 301 - platform.dhd-dz.com. Workers' fetch default (redirect: follow) rewrites a POST into a GET on 301/302/303, so DHD's Laravel rejected create/order with 'The GET method is not supported'. No adapter code sent a GET - the redirect did.
Fix: the EcoTrack adapter's single request() entry point now uses redirect: manual and re-issues up to 5 hops at the Location with the same method/headers/body, plus a 'redirected too many times' guard. Covers create/validate/update/delete/bulk for any *.ecotrack.dz tenant that rebases to a branded host.

Problem 2 - dispatch 422 'Le champ adresse est obligatoire'
adresse is mandatory on every EcoTrack create; CodFlow sent order.address ?? '', so address-less orders failed at the carrier.
Fix: stop-desk orders (no street address by design) now send the pickup-point commune as adresse; home deliveries without an address are rejected locally with a clear message before any carrier call (single + bulk dispatch).

Tests: 4 new (2 redirect POST/JSON-body preservation, 1 stop-desk adresse fallback, 1 dispatch guard). Typecheck clean; orders + delivery suites 466/466; EcoTrack suite 132/132.

Also: CHANGELOG entry + EcoTrack CONFORMANCE tenant note (DHD 301).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant