40. A slot declares the handling unit it accepts
Status
Accepted (2026-10-24). Additive: no existing event, route or column changes meaning. Reuses the Published Language rules of ADR 0013 and the CloudEvents envelope of ADR 0024.
Context
inventory-storage refuses to stow a sealed case into a bin whose handling
unit is not CASE or PALLET (its ADR 0045 section 4,
ErrBinHandlingUnitMismatch, 409 bin-handling-unit-mismatch). It learns a
bin's handling unit from LocationSlotRegistered, but this context had no
such attribute anywhere (model, REST, events), so no bin could ever take a
case. The mastercase rollout plan (section 4.2) assigns "bin attributes:
handlingUnit (EACH|CASE|PALLET)" to this context, the system of record for
what a coded location is legal for.
Decision
- Model.
LocationSlotcarries an optionalhandlingUnit(shared.HandlingUnit:EACH,CASE,PALLET). The zero value means "none recorded" and is exactly today's behaviour; every slot registered before this ADR has none.DeclareHandlingUnitenforces the invariants: a value outside the enum isErrUnknownHandlingUnit(422 unknown-handling-unit) and a Decommissioned slot refuses the change (ErrSlotDecommissioned,409 already-decommissioned, checked first). There is no way to clear a value; declare another one. - REST.
POST /locationsaccepts an optionalhandlingUnit.PUT /locations/{locationCode}/handling-unitwith{"handlingUnit": "CASE"}sets or changes it on an existing slot and returns the slot (200;400,404,409,422as above). Like the geometry PUT it is naturally idempotent and takes noIdempotency-Key(ADR 0019 covers creations only).GET /locations/{locationCode}and the other slot reads includehandlingUnitwhen set and omit it otherwise. - Events (camelCase, matching
LocationSlotRegistered, not the snake_case ofSiteCapabilityChanged):LocationSlotRegisteredgainshandlingUnit(string enum), omitted when none was recorded, so the payload of every existing slot is byte-identical to before.- New
com.warehouse.wms.facility-layout.locationslot.LocationSlotHandlingUnitDeclared(dataschemaurn:warehouse:facility-layout:events:LocationSlotHandlingUnitDeclared:v1) withdata:locationCode(string, the same identifier as inLocationSlotRegistered),handlingUnit(string enum),declaredAt(RFC 3339 instant, equal tooccurredAt), plus the usualeventName/eventType/occurredAt. Raised through the outbox on every declaration, keyed andsubject-ed bylocationCodeso it lands on the slot's partition after itsLocationSlotRegistered.
- Storage. Migration
0011: nullablelocation_slots.handling_unitwithCHECK (handling_unit IS NULL OR handling_unit IN ('EACH','CASE','PALLET')).
Consequences
- Consumers that ignore unknown fields/types are unaffected. A consumer
keeping a per-bin copy applies last-write-wins per
locationCode:handlingUnitfromLocationSlotRegisteredwhen present, and everyLocationSlotHandlingUnitDeclaredthereafter.inventory-storagedoes this in its own change (it amends its ADR 0045 section 4). - Slots that existed before this ADR stay without a handling unit until
someone declares one, so a deployment must declare the case/pallet bins
(one
PUTeach) before sealed cases can be stowed in them. - Not in this change: bulk import rows do not carry
handlingUnityet, and the reserve-versus-forward-pick bin role of plan section 4.2 is a separate attribute left to its own decision.