Skip to content

Create shipments from orders on the create page (#328) - #337

Merged
Connor-Finn merged 3 commits into
mainfrom
tms/328-create-from-orders
Oct 4, 2026
Merged

Connor-Finn merged 3 commits into
mainfrom
tms/328-create-from-orders

Conversation

@Connor-Finn

Copy link
Copy Markdown
Collaborator

Part 2 of #328.

What changed

  • Entry points: "Create shipment" on an order, and "Ship together" on the orders list, open the create page with the orders attached (?orderIds=; the older ?fromOrderId= still works). "Ship together" is only enabled for two or more available orders that can share a shipment (one customer, one origin, LTL), with the reason shown otherwise.
  • Orders card on the create page, with an "Add order" search limited to orders that can join.
  • Editable autofill (frontend/src/lib/shipmentFromOrders.ts): orders fill empty fields, widen the dates, add each drop as a stop and turn on temperature/hazmat handling; nothing is locked any more. Saving is refused while the form no longer fits the orders, with the reasons listed.
  • Lane matching: a lane from the orders' origin to their last drop that supports their service level is preselected (new GET /api/v1/lanes/between), preferring one whose stops cover the other drops. Drops it doesn't cover become extra stops, with a warning. Otherwise the shipment gets a custom route.
  • The Waypoints card is only shown for a custom route; with a lane, its stops are listed in the Lane card.
  • Saving attaches every order through add-orders, which enforces the same rules server-side.

Testing

  • Backend suite, frontend tests, both type-checks and both lints pass.
  • In the browser against a seeded database:
    • two Nordic LTL orders filled in customer, mode, the Green Bay → Denver lane with the extra Rochester stop and warning, the lane carrier and widened dates
    • switching the mode to FTL listed the conflict and blocked saving
    • saving created the shipment with both orders on the right stops
    • an FTL order on Houston → Atlanta preselected that lane and its carrier
    • "Ship together" enabled and disabled correctly for valid, single, FTL-mixed and multi-customer selections
    • "Add order" offered only compatible orders

🤖 Generated with Claude Code

Connor-Finn and others added 3 commits October 4, 2026 11:13
Part 2 of #328. "Create shipment" on an order and "Ship together" on the
orders list open the create page with the orders attached (?orderIds=),
shown in a new Orders card with an "Add order" search limited to orders
that can join. The orders fill in customer, mode, route, stops and dates
(lib/shipmentFromOrders): only empty fields are filled, dates widen, each
drop becomes a stop, and nothing is locked any more. Saving is refused
while the form no longer fits the orders, and every order is attached on
save.

A lane from the orders' origin to their last drop is preselected through
the new GET /api/v1/lanes/between, preferring one whose stops cover the
other drops; drops it doesn't cover become extra stops, with a warning.
Otherwise the shipment gets a custom route. The Waypoints card is only
shown for a custom route.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The create page preselected any lane between the orders' origin and last
drop, so an FTL-only lane could be suggested for LTL orders. Matching now
keeps to lanes whose service level is the orders' or Both, as auto-
assignment already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ship together on the orders list is disabled until two or more available
orders are selected that can share one shipment (one customer, one origin,
LTL); the reason is shown beside the button, so the create page never opens
for a set it would refuse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Connor-Finn
Connor-Finn merged commit 80028d3 into main Oct 4, 2026
@Connor-Finn
Connor-Finn deleted the tms/328-create-from-orders branch October 4, 2026 10:35
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