Repository navigation
fix(orders): allow partial payload edits and keep addresses sent with coordinates - #411
Merged
roncodes merged 1 commit intoOct 23, 2026
Conversation
… coordinates - UpdateOrderRequest no longer applies creation's route requirements to a payload object: an update may send only entities (with entities_mode=replace), only a new dropoff, or an empty waypoints list. - Place::createFromMixed treats an array as bare coordinates only when it has no address fields. A structured address sent with latitude/longitude keeps its street and uses those coordinates as its location, with no geocoding lookup. Previously the coordinates sent the place down the reverse-geocoding path, which discarded the street and stored a nearby address instead.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #411 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 13596 13616 +20
===========================================
Files 634 635 +1
Lines 49342 49370 +28
===========================================
+ Hits 49342 49370 +28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
Author
|
Review: looks good.
Retargeted to |
roncodes
deleted the
fix/order-edit-partial-payload-and-place-coordinates
branch
October 23, 2026 04:06
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
Integrations (the WooCommerce plugin and the new Shopify app) cannot safely edit an order after creating it:
UpdateOrderRequestextendsCreateOrderRequestunchanged, so anyPUT /v1/orders/{id}with apayloadobject must resendpickup,dropofforwaypoints. Sending only new entities (entities_mode=replace) or only a new dropoff returnsThe payload.pickup field is required.Place::createFromMixed()checksUtils::isCoordinatesStrict()before the structured-array branch. Any array withlatitude/longitudematches, so{street1: "1100 4th Ave", latitude, longitude}goes tocreateFromCoordinates(), which drops the street and reverse-geocodes. Reproduced locally: an order created with1100 4th Avestored909 5TH AVENUE; an edit to500 Pine Ststored400 PINE STREET. This affects order creation as well as updates.Changes
UpdateOrderRequest::rules(): whenpayloadis an object,payload.pickup/payload.dropoffarenullableandpayload.waypointsisarray(an empty list is how the controller removes intermediate stops). A payload id and top-level fields keep the create contract. The controller already handled partial payloads correctly.Place::createFromMixed(): the bare-coordinates branch only applies when the array has no address fields (street1,address,city,postal_code). Structured arrays turnlatitude/longitude(orlat/lng) intolocation, and skip the geocoding lookup when both a street and a usable location are present. Addresses without coordinates and bare coordinates behave as before.Place::hasStructuredAddress(),withProvidedLocation(),hasProvidedLocationAndStreet().Replace semantics for entities stay opt-in through the existing
entities_mode=replace, so current API clients that rely on append are unaffected.Verification
RequestContractsTest(partial update rules) andUnit/Models/PlaceCreationAndImportTest(structured address + coordinates keeps street and location without any geocoder call; bare coordinates still reverse-geocode; address-only still geocodes; helper edge cases).1100 4th Ave+ coordinates and it kept1100 4TH AVE;PUTwithentities_mode=replaceand only entities returned no errors and left exactly the two sent items; a dropoff-onlyPUTstored500 PINE STat exactly the sent coordinates.