Skip to main content

Ubiquitous language

Use these exact names in code, API and conversation. The repository's .claude/rules/domain-model.md is the agent-facing source; every term below maps to a code identifier in internal/domain/product unless another path is given. Terms whose code name differs from the spoken or wire name are flagged in the last column.

TermMeaningCode identifierNote
ProductThe master record of one SKU. Registered explicitly before any attribute can be set. Aggregate root.Product
SKUThe product's identity: 1..64 characters, no whitespace, control characters or /. Never changes.SKU, NewSKU, MaxSKULengthKafka key and CloudEvents subject
RegisterCreate a product at version 1. Re-registering an existing SKU only replaces its description.Register; use case RegisterProductREST PUT /products/{sku}
DescriptionOperator text, 0..200 characters, no control characters.description, MaxDescriptionLength, ChangeDescription
ClassificationHow a SKU must be handled: handling tags, temperature class, DOT hazard class. Immutable value object.Classification, NewClassificationREST handlingTags, event handling_tags
Handling tagOne member of the closed set Hazmat, Fragile, TemperatureSensitive, Oversized, HighValue, reported in that stable order.HandlingTag, tagOrder, Tags()
Temperature classStorage band a TemperatureSensitive product needs: Ambient, Chilled, Frozen. Required iff TemperatureSensitive.TemperatureClass, NoTemperatureClass
DOT hazard classTop-level US DOT hazard class 1..9, optional, only with Hazmat. 0 means "not recorded".DOTHazardClass, NoDOTHazardClassSegregation rules are NOT owned here (ADR 0001)
Classification sourceWhere a classification was authored: native (here; every write since stage E) or legacy-import (written by the ADR 0003 importer before stage E and not re-classified since).ClassificationSource, SourceNative, SourceLegacyImportclassification_source / classificationSource
Legacy importHistorical: applying an inventory-storage classification during the migration, never overwriting native.none any more: ImportLegacyClassification was removed at stage E (2026-10-17)ADR 0003; only the legacy-import source value remains
Unit dimensionsLength, width, height in whole mm (1..20000) and weight in whole g (1..2000000) of one unit.UnitDimensions, NewUnitDimensions
Volumelength x width x height in mm3, orientation-free.VolumeMm3()volume_mm3 / volumeMm3
Declared dimensionsVendor- or steward-supplied unit dimensions.PhysicalProfile.Declared(), DeclareDimensionsREST .../dimensions/declared
MeasurementMeasured unit dimensions plus when (measuredAt) and optionally by which device (deviceId).Measurement, NewMeasurement, RecordMeasurementREST .../dimensions/measured
Stale measurementA measurement dated before the current one; rejected.ErrStaleMeasurement409 stale-measurement
Physical profileDeclared dimensions plus the latest measurement, with derived effective values and discrepancy.PhysicalProfile
Effective valuesMeasured if present, else declared, else none. What consumers act on.Effective(), EffectiveSource() (measured, declared, none)
DiscrepancyBoth parts present and measured volume or weight differs from declared by more than 10 % of declared. Information, not a rejection.Discrepancy(), exceedsTenPercent
VersionStarts at 1, +1 per accepted change; guards the write and rides on every event.version, Version(), bumpConsumers apply only a greater version
No changeA command whose result equals the current state: no event, no version bump, nothing saved.commands returning nil events; Writer.persist
Pack levelOne packaging level of a SKU: EACH, INNER, CASE or PALLET, identified by a GTIN (ADR 0011).PackLevel, PackLevelDef, PackagingHierarchyREST .../pack-levels/{level}
GTINThe 14-digit zero-left-padded GS1 number of a pack level; 8, 12, 13 and 14 digit input with a valid mod-10 check digit is accepted. One GTIN identifies exactly one (sku, level), fleet-wide, for ever.gs1.GTIN (internal/domain/shared/gs1), ParseGTINindicator digit 9 (variable measure) is rejected
Units per packThe direct factor from a pack level to eaches (1 for EACH), stored, not recomputed by chaining. Eaches are the ledger unit; a bare quantity never means cases.PackLevelDef.UnitsPerPack()REST unitsPerPack, event units_per_pack
Quantity of childHow many packs of the child level make one of this level (at least 2).PackLevelDef.QtyOfChild()REST qtyOfChild
SupersedeDeclaring a new GTIN at a level that is active: the old level is end-dated (superseded) and kept, the new one starts. The only way to change a content quantity.DeclarePackLevelProductPackLevelRetired then ProductPackLevelDeclared
RetireEnd-date the active level (effectiveTo); the GTIN keeps resolving, inactive, and is never reassigned.RetirePackLevelREST POST .../retirements
Local copyA downstream context's own table of this context's facts, fed by events and guarded by version.(in the consumers)ADR 0001, ADR 0003 stage D
Unit of workOne atomic transaction around load, command, guarded save and outbox insert.ports.UnitOfWork
OutboxThe table events wait in until the relay publishes them.outbox_events, ports.OutboxRepository, outbox.Relay

Vocabulary only (not implemented)​

ADR 0001 lists these as explicitly out of scope for v1, to be decided by later ADRs: lot / serial / expiry tracking policy, shelf life, kits and bundles, velocity class, lifecycle states (discontinue, block), and every commercial attribute (title, price, images). Pack hierarchy, units of measure and GTINs left this list with ADR 0011; variable-measure items (GTIN indicator digit 9), commingling of stock by GTIN across owners and mixed cases (no pack GTIN) are still not designed. There is also no "unclassify" command or event in v1, and no measurement history (ADR 0002).