Skip to main content

Ubiquitous language

Synced from outbound-shipping

This page is a copy of docs/docs/ddd/ubiquitous-language.md on develop, derived from that repository's code. Edit it there, then re-sync.

The terms below are the ones the code, the API and the events use. Each row names where the term lives, so a word in a conversation can be found in the source. Terms owned by a neighbour are marked and are used here only as facts.

Source: internal/domain/outboundload/load.go, internal/domain/shippingpackage/package.go, internal/domain/billoflading/bol.go, internal/domain/shared/ids.go, internal/domain/shared/shortship.go, internal/application/usecases/usecases.go.

Core terms​

TermMeaningIn the code
Outbound loadThe packages planned to leave together on one trailer for one cutoff. Planned automatically from the first manifested package.aggregate outboundload.OutboundLoad, id shared.LoadID, table outbound_loads
Cutoff key(site, cpt, operating date, ship method): at most one open load exists per key.outboundload.LoadKey, partial unique index uq_open_load_per_cutoff
CPT (critical pull time)The time of day a site's cutoff is due, from the site's schedule. Neighbour term (process-path-management).shared.CptID, local copy cpt_schedules
CutoffThe instant by which the load's packages must be on the truck.OutboundLoad.Cutoff(), column cutoff
Operating dateThe local calendar date a load ships on (YYYY-MM-DD, resolved in the site's timezone).outboundload.OperatingDate
Ship methodThe carrier service the cutoff entry ships by.shared.ShipMethod
Open loadA load in PLANNED or LOADING.outboundload.StatePlanned, StateLoading
Shipping packageOne manifested package and where it is on its way to the truck. v1 ships packages, not pallets.aggregate shippingpackage.ShippingPackage, id shared.PackageID
ManifestThe upstream fact that a package was packed and labelled.PackageManifested (consumed), usecases.Manifest
ExpectedA manifested package that has not been staged yet.shippingpackage.StateExpected
StagingPutting a package at a Staging location of its site before loading.ShippingPackage.Stage, PackageStaged
Staging locationA facility-layout location whose role is Staging. Neighbour term (facility-layout).local copies zones, locations; ErrNotStagingLocation
LoadingScanning a package onto its load through the load's door. Also the load state while that happens.ShippingPackage.Load, StateLoading, PackageLoaded
DoorThe dock door a load is loaded through, assigned from a dock appointment.shared.DoorCode, OutboundLoad.AssignDoor, LoadDoorAssigned
Dock appointmentThe booking that names the door, the carrier and optionally the cutoff. Neighbour term (dock-scheduling).shared.AppointmentID, local copy dock_appointments
TrailerThe physical trailer at the door. Neighbour term (yard-management).shared.TrailerID, OutboundLoad.Trailer()
Seal numberThe seal the yard recorded on departure; the bill of lading certifies it.Departure.SealNumber, billoflading.ErrSealMissing
UnloadTaking a loaded package back off the load, back to STAGED, before departure.ShippingPackage.Unload, PackageUnloaded
Short-shipDeliberately leaving a package off a load, always with a reason.shared.ShortShip, StateShortShipped
CloseThe supervisor's declaration that every package is loaded or short-shipped.OutboundLoad.CloseLoad, LoadClosed
ReopenReturning a CLOSED load to LOADING before departure.OutboundLoad.ReopenLoad, LoadReopened
CancelDropping a PLANNED load that has no packages.OutboundLoad.CancelLoad, LoadCancelled
Ship-confirmThe fact that the load physically left, taken from the trailer's departure, never from a click.OutboundLoad.ConfirmShipment, ShipmentConfirmed, StateShipConfirmed
DepartureThe yard's fact that a trailer left: trailer, seal and time. Neighbour fact.TrailerDeparted (consumed), usecases.Departure
ShippedState of a package on a confirmed load.shippingpackage.StateShipped, MarkShipped
Bill of lading (BOL)The shipping document of one confirmed load, issued exactly once, voidable.aggregate billoflading.BillOfLading, id shared.BolNumber, table bills_of_lading
VoidInvalidating an issued bill of lading with a reason; the shipment is not undone.BillOfLading.Void, BillOfLadingVoided
Missed loadA package that was not loaded by its cutoff (sweep) or by the trailer's departure. Raised once per package.ShippingPackage.FlagMissedLoad, PackageMissedLoad, column missed_flagged
Missed-load sweepThe scheduled run that flags missed packages after a cutoff.usecases.SweepMissedLoads, POST /missed-load-sweeps
DivertedA package that fulfillment-execution diverted before loading; it is short-shipped with reason DIVERTED.PackageDiverted (consumed), usecases.DivertPackage
Source order idThe order-management order the package ships for; what ShipmentConfirmed.orders lists.ShippingPackage.SourceOrderID()
Order ref (work unit ref)The manifest's own order reference, stored verbatim and never parsed.ShippingPackage.WorkUnitRef()
Load adherenceThe share of a site's loads that have closed, per cutoff and operating date (loads_closed / loads_total). The board also stores closed_on_time, which the report does not use.load_board, GET /reports/load-adherence
Load boardThe projection folded from this service's own analytics stream.table load_board, usecases.ProjectBoard
Loads at riskOpen loads whose cutoff is within the horizon (default four hours).MCP tool loads_at_risk

Technical terms​

TermMeaningIn the code
OutboxEvents written in the aggregate's transaction and relayed to Kafka.outbox_events, postgres.OutboxRepo, outbox.Relay
Inbox (processed event)The (consumer, event id) claim that makes a consumer idempotent.processed_events, usecases.Intake
OutcomeWhat a consumer did with an event: applied, duplicate, ignored.usecases.Outcome
Analytics twinThe copy of every published event on the analytics topic.warehouse.outbound-shipping.analytics
Idempotency keyThe REST header that makes a POST safely repeatable.Idempotency-Key, table idempotency_keys
Local copyA neighbour's data kept from its events instead of queried live.cpt_schedules, zones, locations, dock_appointments, door_work_completions
Dead letterA consumed message that could not be applied, parked on <topic>.dlq.internal/adapters/inbound/kafka/deadletter.go

State vocabularies​

  • Load: PLANNED, LOADING, CLOSED, SHIP_CONFIRMED, CANCELLED.
  • Package: EXPECTED, STAGED, LOADED, SHIPPED, SHORT_SHIPPED.
  • Bill of lading: ISSUED, VOIDED.