Repository navigation
Keep stops and order links when shipments change; flag lane mismatches (#328) - #338
Merged
Merged
Conversation
#328) Part 3 of #328 (work in progress: docs and full-suite run still to do). - syncShipmentStops reconciles stops instead of deleting and recreating them, so orders keep their drop stop when a draft shipment is edited; removing a stop orders still drop at is refused. - Adding an order with a new drop puts it before the destination, renumbers stops 1..n and emits shipment.updated so a custom route is re-planned. - Combine/convert put the shipment on a lane only when one matches its stops and service level exactly; otherwise it stays a custom route. - A shipment can be taken off its lane (laneId: null). - The shipment page warns when a lane shipment's stops don't match its lane, with 'Switch to custom route' and 'Save as new lane'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 tasks
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.
Part 3 of #328. Closes #328.
What changed
syncShipmentStopsused to delete and recreate every stop on any edit of a draft with waypoints (the edit page always sends them), so orders silently lost theirdeliveryStopIdand could never be marked delivered. It now reconciles: stops still on the route keep their row and are renumbered, new locations get new stops, and stops off the route are deleted. Removing a stop that orders still drop at is refused (StopStillHasOrdersError).shipment.updatedis emitted, so a custom route is re-planned.assignMatchingLane); otherwise it stays a custom route and gets a planned route.PUT /api/v1/shipments/:idacceptslaneId: null, taking a shipment off its lane.Testing
🤖 Generated with Claude Code