Skip to main content

Ubiquitous language

The terms customer-ordering speaks, each with the identifier that implements it in the code of this repo, plus the neighbour terms it uses and the words most often confused with them. Where the glossary and the code disagree the code is right. Source: internal/domain/*, internal/application/*, apis/openapi.yaml.

Own terms​

TermDefinitionCode identifierNot to be confused with
ShopperThe synthetic customer who places orders: a unique lower-cased e-mail and up to 20 saved addresses; state ACTIVE only, no events.shopper.Shopper (internal/domain/shopper), table shoppersVendor (vendor-connectivity): the organisation that runs a fulfilment node. A shopper never meets a vendor.
Saved addressA ship-to under a stable addressId; checkout may name it with shipToAddressId and it is copied into the order.shopper.SavedAddress, table shopper_addressesThe order's own ship-to, which no later edit of the saved address changes.
Customer orderWhat the shopper bought: lines, a ship-to, one promise per shipment group and a derived status.customerorder.CustomerOrder (aggregate root), table customer_ordersPurchase order at order-sourcing / vendor: one instruction per group.
Ship-toThe delivery address. Synthetic PII held only here; served by one restricted route and never carried by an event.shipto.ShipTo (value object)Destination postal prefix: the first 3 letters or digits of the normalised postal code, the only part that leaves this context in an event.
Order lineOne catalogue item and a quantity, numbered lineNo (at most 100 per order).customerorder.OrderLine, table order_linesA PO line at a vendor, which names a node-specific listing.
Chosen delivery day / consolidation eligibleOn a CONSOLIDATED group: the local date of deliverByLatest (in the group's timeZone) the shopper chose at placement, and delivery-promise's answer whether that option leaves the network time to merge. Unknown is absent, never false.GroupPromise.ChosenDeliveryDay, GroupPromise.ConsolidationEligible, columns order_groups.chosen_delivery_day, consolidation_eligible (ADR 0013)Tier: the day is a record of the choice, a later PromiseRevised moves the window, not the day.
Consolidation keyThe opaque keyed hash of the shopper and the normalised ship-to (no name, no phone) that rides on CustomerOrderPlaced so order-sourcing can merge the groups of one shopper and one address without seeing the address. Absent when no secret is configured: the order never merges.customerorder.CustomerOrder.ConsolidationKey, shipto.ShipTo.NormalizedAddress, CONSOLIDATION_KEY_SECRET (ADR 0012)Stop key (shipping-and-tracking): an address-only hash computed downstream; not the same value.
Shipment group / group promiseThe lines promised and shipped together from one node, with the snapshot of their promise and what events reported since (at most 50 per order).customerorder.GroupPromise, table order_groupsPromise (delivery-promise): the authoritative commitment. This is a snapshot, refreshed by UpdateGroupPromise on PromiseRevised. Package: a group can ship as several packages.
Order statusThe customer-facing summary: PLACED, IN_FULFILLMENT, PARTIALLY_SHIPPED, SHIPPED, PARTIALLY_DELIVERED, DELIVERED, LOST, RETURNED, CANCELLED, derived from the group states and never set directly.customerorder.Status, function derive (status.go)The assignment state at order-sourcing and the promise state at delivery-promise.
Group statusPROMISED, LOCKED, SHIPPED, DELIVERED, LOST, RETURNED, CANCELLATION_REQUESTED, CANCELLED.customerorder.GroupStatusThe order status.
CheckoutThe act of turning a cart into an order: make and confirm a promise per group, then store the order and raise CustomerOrderPlaced.use case usecases.PlaceOrder (POST /checkout)Quote: asking delivery-promise for offers, which holds no capacity.
OfferA quoted delivery window the shopper saw; checkout consumes it into a promise.promising.Offer, RequoteRequiredPromise. An expired or consumed offer is answered 409 offer-not-quotable with fresh offers.
Cancellation requestA cancel is a request: unlocked groups become CANCELLATION_REQUESTED and order-sourcing accepts or refuses.CustomerOrder.CancelOrder, ConfirmGroupCancelled, RefuseGroupCancellation; POST /orders/{orderId}/cancellationsA cancelled group: CANCELLED only after FulfillmentCancelled.
LockThe moment order-sourcing commits a group to a node (FulfillmentLocked); after it the shopper can no longer cancel the group.CustomerOrder.MarkInFulfillmentPlacement.
Order tracking viewThe event-fed read model behind GET /orders/{orderId}/tracking: per-group signals, packages, assignment links.views.Tracking, tables group_signals, tracking_packages, tracking_package_groups, assignment_linksThe package journey that shipping-and-tracking owns.
Policy CheckoutPromisingFor each group make the promise with the offer the shopper saw; if an offer is unusable re-quote every group and place nothing.usecases.PlaceOrderRe-promise (delivery-promise revising a confirmed promise): checkout never revises.
Policy CancelOnUnfulfillableWhen delivery-promise reports PromiseUnkeepable the PROMISED group is cancelled and CustomerOrderCancelled raised.CustomerOrder.CancelUnkeepableGroup, Consumer.ApplyPromiseUnkeepableA shopper's cancellation.
InboxThe claim of a CloudEvents id so an event is applied at most once.table processed_events, port ports.InboxThe idempotency key of a REST POST.
Idempotency recordThe stored answer of a POST, replayed for 24 h; only an answer that is final for the request is stored (a success, a FINAL or OUTCOME refusal, ADR 0019).table idempotency_keys, idempotency.RecordThe inbox.
OutboxEvents written in the order's transaction and published by the relay.table outbox_events, port ports.EventOutboxThe topic itself.

Neighbour terms this context uses​

Definitions belong to the owning context; this context only holds copies of their ids and values.

TermOwnerWhat it means here
Delivery offer, promise, promiseIddelivery-promisequoted and made synchronously at checkout; promiseId is stored on the group
Service tierdelivery-promiseSAME_DAY, NEXT_DAY, TWO_DAY, STANDARD, CONSOLIDATED (customerorder.Tier, ADR 0013)
Ship-by, deliver-by window, time zonedelivery-promiseShipBy, DeliverByEarliest..DeliverByLatest, optional IANA TimeZone (ADR 0009)
Witness nodedelivery-promisewitnessNodeId: the node that proved feasibility; the shipping node is the one in FulfillmentLocked
Revision numberdelivery-promiserevisionNo; a stale PromiseRevised is ignored
Promise kept / brokendelivery-promisethe verdict shown in tracking with lateByMinutes; it does not change the order status
Fulfillment assignment, assignmentIdorder-sourcinglinked to a group by FulfillmentLocked (assignment_links)
Unsourceableorder-sourcingno node can meet the promise; recorded in tracking only
Tracking number, label, scanshipping-and-trackingtracking_packages rows; the label is the only artefact outside this context that carries the address
Catalog itemthe storefront catalogueorder lines name catalogItemId only

Words not to use​

  • "Customer" for the aggregate: the code says shopper.
  • "Account", "user", "login": there is no authentication; a shopper is identified by shopperId in the request.
  • "Delivered" for a kept promise: an order is DELIVERED on PackageDelivered; kept or broken is a separate verdict.
  • "Cancelled" for a pending cancellation: that is CANCELLATION_REQUESTED.
  • "ETA window" for the promise window: the promise (deliverByEarliest .. deliverByLatest) is the coarse commitment made at checkout; the ETA window (etaStart, etaEnd) is a finer, later, day-of estimate of at most two hours for one package, shown only while it is OUT_FOR_DELIVERY (ADR 0014). It never changes the promise or its verdict.
  • "Return" for RETURNED: the group state records that a package was returned to the sender (PackageReturned); there is no returns workflow in this context.