Skip to content

Enforce what can share a shipment: FTL/LTL, one customer, pickup stop (#325) - #334

Merged
Connor-Finn merged 4 commits into
mainfrom
tms/325-service-level-rules
Oct 4, 2026
Merged

Connor-Finn merged 4 commits into
mainfrom
tms/325-service-level-rules

Conversation

@Connor-Finn

Copy link
Copy Markdown
Collaborator

Part 2 of #325.

What changed

  • What can share a shipment (commands/orders/shipmentLoadRules.ts), enforced inside the add, combine, convert and split commands:
  • Shipments created from orders take serviceLevel, tempControlled and hazmat from them; before this, convert, combine and split never set them, so the rules were skipped.
  • Shipments created from orders start with a pickup stop at the origin, so leaving the origin is tracked (otherwise they never started or completed).
  • Combining orders bound for different places ends the shipment at its last drop, not the first order's.
  • OrderConversionService reports the same checks per order; mixed customers and multiple FTL orders are now errors, not warnings.
  • Adds scripts/backfill-shipment-service-level.ts (dry run unless --apply).

Testing

  • Full backend suite, tsc and lints pass.
  • End to end: combining two orders through the API gave a shipment with service level LTL, a pickup stop and the right final destination.

🤖 Generated with Claude Code

Connor-Finn and others added 4 commits October 4, 2026 10:48
Part 2 of #325. An FTL shipment carries exactly one order and FTL/LTL
orders never share a shipment, enforced inside the add, combine, convert
and split commands; LTL shipments may mix customers. Shipments created
from orders now take serviceLevel, tempControlled and hazmat from them,
where before convert/combine/split never set them, so the rules were
skipped. The conversion service reports the same checks per order, and
combining mixed or multiple FTL orders is now an error, not a warning.

Adds scripts/backfill-shipment-service-level.ts (dry run unless --apply).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Convert, combine and split created only delivery stops, so leaving the
origin was never tracked for those shipments: they never moved from ready
to in_progress, their orders never went in transit and they never
auto-completed (#324). They now start with a pickup stop at the origin,
like shipments created through CreateShipmentCommand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Combining orders bound for different places set the shipment's destination
to the first order's, so the route header and journey checkpoints pointed
at a middle stop. The destination is now the last drop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Several customers' freight on one truck will be a consolidation of
per-customer shipments, so each customer keeps their own bill of lading,
invoice and portal view. Until then, adding or combining orders for a
different customer is refused, and the compatibility check reports mixed
customers as an error instead of a warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Connor-Finn
Connor-Finn merged commit fc09f31 into main Oct 4, 2026
@Connor-Finn
Connor-Finn deleted the tms/325-service-level-rules branch October 4, 2026 09:49
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