ADR 0012: Case-pick faces and the CASE pick unit
Status
Accepted (2026-10-24). Extends
ADR 0003 (local copies of
consumed contracts) and respects
ADR 0011 (real Postgres and
Kafka only). Additive on the wire; one migration (0003_case_pick_faces). Part
of the mastercase / GTIN programme (contract P11-1).
Context
A SKU that is picked in whole cases does not belong on an each-pick face sized
for its eaches: the face must hold CASES, and its capacity is a number of cases
derived from the case's cube and weight. Product-master declares the pack levels
(ProductPackLevelDeclared / ProductPackLevelRetired); this context must not
look them up live.
Decision
- A local copy of the pack levels is kept in Postgres by a consumer of
product-master's pack-level events (
PACK_LEVEL_MODE=kafka, stable groupPACK_LEVEL_CONSUMER_GROUP), version-guarded and idempotent by CloudEvents id. - A face is a CASE-pick face when its zone is in
CASE_PICK_ZONE_CODES(comma separated; default empty, meaning no case-pick faces and the previous behaviour byte for byte). - A SKU is planned as
pickUnit: CASEonly when case faces exist, it has an active CASE pack level with a size, and the greatest common divisor of its demand line units is a whole number of cases. Otherwise it isEACH. A CASE SKU is placed only on case faces and an EACH SKU only on other faces. - The face's
casesCapacityis the number of whole cases it holds, the tighter of the volume and the weight limit (at least one, or the face is not eligible:no-capacity-fit). - Output is additive: assignments in REST responses carry
pickUnitand, for CASE,casesCapacity;SlotPlanApproved.assignments[]carriespick_unitandcases_capacityonly for CASE assignments, so the payload of an each assignment is byte-identical to before. Quantities elsewhere remain eaches.
Consequences
- Two new env vars:
PACK_LEVEL_CONSUMER_GROUP(mandatory withPACK_LEVEL_MODE=kafka) andCASE_PICK_ZONE_CODES(optional). Both are chart values (config.packLevelConsumerGroup,config.casePickZoneCodes). - Retiring the CASE level makes the SKU fall back to an each-pick face at the next plan; a plan already Approved is not rewritten.
- Facility layout is not asked which faces are case faces: the zone list is declarative configuration of this context.