Skip to content

Add consolidations: one truck run for several shipments (#329) - #341

Merged
Connor-Finn merged 1 commit into
mainfrom
tms/329-consolidation
Oct 4, 2026
Merged

Connor-Finn merged 1 commit into
mainfrom
tms/329-consolidation

Conversation

@Connor-Finn

Copy link
Copy Markdown
Collaborator

Slice 2 of #329: the Consolidation entity and page.

  • Consolidation, ConsolidationStop, ConsolidationShipment (unique shipmentId: one run per shipment), ShipmentStop.consolidationStopId, and ConsolidationReadModel. Shipment gets no new index; ShipmentStop's redundant (shipmentId) index is swapped for (consolidationStopId).
  • Commands: create, update (carrier, notes), add/remove shipments (draft only), archive (a draft frees its shipments). Stops rebuild on every change: every pickup before every drop, shared locations share a stop, existing stop rows kept.
  • Projection, backfill step (--only=consolidations), routes with schema blocks under shipments:write.
  • Consolidations list and detail pages, a shipment picker, and a "Rides on CON-…" link on the shipment page.

Tested in the browser: a three-shipment, two-customer run; remove; duplicate refusal (400); missing id (404); archive freeing shipments. Full backend suite, tsc, lints pass.

Not yet: tracking (slice 3), drop reordering, map, cost allocation, per-customer Ship together, www.

🤖 Generated with Claude Code

A Consolidation groups shipments, usually for several customers, into one
run with its own stops: every pickup before every drop, shared locations
sharing a stop, and each shipment stop linked to the run stop serving it.
Commands to create, update, add/remove shipments (draft only) and archive
(a draft frees its shipments), a read model with projection and backfill,
and a Consolidations list and detail page. A shipment links to its run.

ShipmentStop's redundant (shipmentId) index is dropped to make room for
(consolidationStopId), keeping it at three.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Connor-Finn
Connor-Finn merged commit d49ff28 into main Oct 4, 2026
@Connor-Finn
Connor-Finn deleted the tms/329-consolidation branch October 5, 2026 08:24
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