Conversation
…irects and fill required adresse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).