ADR 0002: Physical profile, declared versus measured
Status
Accepted (2026-10-06).
Context
No context in the fleet knows how big or how heavy one unit of a SKU is. Warehouses get that number from two sources that routinely disagree:
- Declared: what the vendor or the master-data steward says (catalogue data, packaging spec). Available before the first unit arrives, often wrong.
- Measured: what a dimensioning device (a cubiscan) or a person with a tape and a scale recorded on a real unit. Arrives later, is trusted more.
Downstream uses (expected package weight at the weigh check, cube-based slot fit, cube-based storage capacity) need one number to act on, and stewards need to see when the two sources disagree.
Decision
Product carries a PhysicalProfile value object with two optional parts:
declared:UnitDimensions= length, width, height in whole millimetres and weight in whole grams.measured:UnitDimensionsplusmeasuredAt(when the unit was measured, supplied by the caller) and an optionaldeviceId(free text, e.g. the cubiscan's asset tag; empty for a manual measurement).
Rules:
- Integer units. Millimetres and grams as integers, never floats, so two services comparing the same value never disagree on rounding. Consumers convert at their own edge (facility-layout uses kg and m3).
- Bounds. Each dimension 1..20 000 mm, weight 1..2 000 000 g. Zero or negative values are rejected; the bounds catch unit mistakes (metres typed as millimetres) rather than model real limits.
- Orientation is not normalised. Length, width and height are stored as
given. Volume (
volumeMm3= l x w x h) is orientation-free; a consumer that needs a fit check sorts the three sides itself. - Effective values.
effective=measuredif present, elsedeclared, else absent.effectiveSourceismeasured,declaredornone. Consumers act oneffectiveonly. - Latest measurement wins, by
measuredAt. Recording a measurement whosemeasuredAtis earlier than the current measurement's is rejected (409stale-measurement), so a delayed upload from a device cannot overwrite a newer reading.measuredAtmay not be in the future relative to the service clock. - Discrepancy. When both parts exist, the profile reports
discrepancy=trueif the measured volume or the measured weight differs from the declared one by more than 10 % of the declared value (|m - d| * 10 > d, integer arithmetic). The tolerance is fixed in v1; a per-category tolerance is a later decision. A discrepancy is information for stewards, not a rejection: the measurement is still recorded and still becomes effective. - Classification is independent.
Oversizedstays a steward decision. The model does not derive or validate handling tags from dimensions (no rule exists yet that the business has agreed to).
Events: ProductDimensionsDeclared and ProductMeasured each carry the full
physical profile state (declared, measured, effective, effective source,
discrepancy, version), so a consumer overwrites its copy without having to
merge partial updates.
Consequences
- Downstream consumers (later phases, not this one): fulfillment-execution can derive expected package weight as effective unit weight x scanned quantity; inventory-storage can check a unit's volume against slot capacity at stow; warehouse-planning can compute cube-based storage capacity.
- A measurement history is not kept in v1 (only the latest). If audit of past readings becomes a need, it is an additive table and a new ADR.