Inventory & Storage Domain Events 1.0.0

Domain-event catalog for the inventory-storage bounded context, the WMS-tier authoritative record of what is held where, and what portion of it is usable. This context implements chaotic (random) stow: there is no fixed product location — an inbound item may be stowed into any free bin, and this service records the exact bin it landed in. It supplies "stock reality" to the Work Planning bounded context (wes-work-planning) and makes allocation a revocable reservation, so a failed physical pick never strands an order.

Envelope. Every message on this channel is a CloudEvents 1.0 structured-mode JSON document with content type application/cloudevents+json. The CloudEvents context attributes carry routing and identity (specversion, id, source, type, subject, time, datacontenttype); the business payload lives entirely under data. source is always /warehouse/inventory-storage, and subject is the id of the aggregate instance the event is about (a reservation id, a stock unit id, or a bin id).

The type attribute follows the platform-wide reverse-DNS convention com.warehouse.<subdomain>.<bounded-context>.<entity>.<EventName> — all lowercase except the final PascalCase event name. For this context the subdomain is wms (Warehouse Management System, a core subdomain) and the bounded context is inventory-storage, so for example a stow produces com.warehouse.wms.inventory-storage.stock.ItemStowed and a revoked allocation produces com.warehouse.wms.inventory-storage.reservation.ReservationRevoked.

Aggregates and entity groupings. The StockUnit, Reservation and cycle-count events are grouped below; the transfer, relocation, bin-level, container and held-stock events are described on their own messages. The StockUnit aggregate (entity segment stock) raises StockReceived, ItemStowed, LocationRecorded and ItemUnlocated. The Reservation aggregate (entity segment reservation) raises StockReserved, ReservationExpired, ReservationRevoked and StockPicked — StockPicked is grouped with the reservation because it is emitted by ConfirmPick when a reservation is consumed, and reservation id is the only identity it carries. The entity segment bin groups CycleCountCompleted and DiscrepancyDetected: the RunCycleCount use case publishes both directly while it changes StockUnits, and no Bin aggregate is loaded.

What reaches Kafka. This document is the complete domain-event catalog for the bounded context. Two topics carry a subset of it: warehouse.inventory.events (the integration contract — StockReserved, ReservationRevoked, the transfer replies, the transfer receipt/stow events, BinStockLevelChanged (the per-bin absolute level feed, ADR 0040), and the promoted exception facts DiscrepancyDetected, ItemUnlocated and ItemStowed (ADR 0043 — byte-identical copies of the analytics feed), from internal/adapters/outbound/kafka/publisher.go) and warehouse.inventory.analytics (the analytics data product — every message below except LocationRecorded, from internal/adapters/outbound/kafka/analytics_publisher.go). Each message says which topics it reaches. LocationRecorded is in-process only (no consumer; decided 2026-10-06). Product-master owns product classification (ADR 0034); the legacy ProductClassified and the one-shot republish-product-classifications backfill that re-emitted it were removed at product-master ADR 0003 stage E (2026-10-17).

Consumed. This service also consumes product-master's warehouse.product-master.events (channel below, ADR 0034) into a local copy of every SKU's classification that StowStock reads. Applying it raises no event here. It also consumes fulfillment-execution's TaskCompleted from warehouse.fulfillment.events (channel below, ADR 0035) to confirm a completed order's reservations as picked once the order's LAST PICK task completes (one PICK task per order line, counted per order); that raises this service's own StockPicked (analytics topic) per reservation. And it consumes inbound-receiving's ReceiptLineReceived from warehouse.inbound-receiving.events (channel below, ADR 0037): a line with condition=Good is booked as a staged receipt through the existing ReceiveStock use case (the same StockReceived as POST /stock-receipts, analytics topic; quantity staged, stow stays the RF action); a Damaged line is booked as HELD stock (ADR 0052): never usable, raising StockHeld, until a disposition settles it. And it consumes returns-processing's ReturnLineStaged from warehouse.returns-processing.events (channel below, ADR 0044): the RESTOCK disposition's handover is booked through the SAME ReceiveStock seam as a receipt line (same StockReceived, analytics topic; quantity staged, stow stays the RF action).

CloudEvents is mandatory (ADR-0024). Every message on both topics is exactly the CloudEvents 1.0 structured-mode event documented here — all of specversion, id, source, type, subject, time, datacontenttype and dataschema are required — and every Kafka message carries the header content-type: application/cloudevents+json; charset=UTF-8. The same type names an occurrence on both topics; dataschema (urn:warehouse:inventory-storage:<events|analytics>:<EventName>:v1) names the payload shape. Each schema's data is the exact wire payload; StockReserved and ReservationRevoked, which reach both topics, give one data shape per dataschema. There is no other envelope.

  • #inventory-storage
  • #stock
  • #reservation
  • #bin
  • #product
  • #product-master
  • #fulfillment-execution
  • #inbound-receiving
  • #returns-processing

Servers

  • kafka.warehouse-systems.internal:9092kafkaproduction

    The shared warehouse-systems Kafka broker. Locally this is the broker started by ~/warehouse-systems/docker-compose.kafka.yml, addressed via the KAFKA_BROKERS environment variable (required, no default). Events always leave through the transactional outbox and its relay (ADR 0042); there is no log publisher.

    Security:
    security.protocol:PLAINTEXT

Operations

  • SUB warehouse.inventory.events

    The outbound integration topic for this bounded context (the Topic constant in internal/adapters/outbound/kafka/publisher.go). Reaching it: StockReserved and ReservationRevoked (keyed by reservation id), the transfer replies and receipt/stow events (keyed by transfer line id), StockRelocated (keyed by relocation id, ADR 0039), BinStockLevelChanged (keyed by <bin>:<sku>, ADR 0040) and the promoted exception facts DiscrepancyDetected, ItemUnlocated and ItemStowed (ADR 0043 — byte-identical copies of the analytics feed, consumed by exception-management; ItemStowed has no consumer yet) and the container events ContainerRegistered, ContainerStowed, CaseBroken and ContainerEmptied (keyed by LPN, ADR 0045/0046), the tote events ToteRegistered, ToteFilled and ToteStowed (keyed by LPN, ADR 0054) and the held-stock events StockHeld, StockReleased and StockDispositioned (keyed by held unit id, ADR 0052). The legacy ProductClassified was retired at product-master ADR 0003 stage E (2026-10-17). The primary downstream consumer is wes-work-planning, which dispatches on their full type strings and projects them into its UsableInventoryObserved read model, keyed by SKU.

    Consume inventory-storage domain events.

    Subscribe to the domain events raised by the inventory-storage bounded context. Messages are CloudEvents 1.0 structured-mode JSON; discriminate on the FULL type context attribute, which is fixed per message via a const in the schemas below, and dedupe on id. Consumers must ignore unknown type values (forward compatibility).

    Operation IDconsumeInventoryStorageEvents

    Available only on servers:

    • #inventory-storage

    Accepts one of the following messages:

    • #0Stock Reserved

      A quantity was revocably bound to demand.

      Raised by the ReserveStock use case when a reservation is successfully created against usable inventory (on-hand minus active reservations minus held/unlocated stock). The binding is revocable and carries a timeout, so a physical failure downstream never strands the demand.

      Published to both topics. On warehouse.inventory.events (dataschema urn:warehouse:inventory-storage:events:StockReserved:v1) the data payload is the adapter's reservationData shape — sku, quantity, demand_ref — and the reservation id is the CloudEvents subject and the Kafka key. wes-work-planning consumes this exact type to update its UsableInventoryObserved read model by SKU. On warehouse.inventory.analytics (dataschema ...:analytics:StockReserved:v1, Kafka key = reservation id — ADR 0021) data is {sku, reservation_id, quantity}.

      allOf

      CloudEvents envelope for a StockReserved domain event, on both topics; dataschema selects the data shape.

      • #reservation

      Examples

    • #1Reservation Revoked

      A reservation was cancelled and its quantity returned to usable.

      Raised by the RevokeReservation use case. Revocation is the mechanism that keeps a physical failure — a blocked pod, a lost tote, a chute jam, a short pick — from stranding an order: the quantity goes back to usable and the demand can be re-allocated against a different holding.

      Published to both topics. On warehouse.inventory.events (dataschema urn:warehouse:inventory-storage:events:ReservationRevoked:v1) the domain event carries only the reservation id, so the adapter enriches it through ports.ReservationRepo and emits the same sku / quantity / demand_ref shape as StockReserved; if the lookup finds nothing the publish fails rather than emitting a partial payload. The reservation id is the subject and the Kafka key. wes-work-planning consumes this exact type. On warehouse.inventory.analytics data is {reservation_id, sku}.

      allOf

      CloudEvents envelope for a ReservationRevoked domain event. The data member is enriched by the outbound Kafka adapter, which looks the reservation up through ports.ReservationRepo because the domain event carries only the reservation id.

      • #reservation

      Examples

    • #2Transfer Stock Allocated

      Origin-site stock was reserved for a network transfer line.

      Raised by the AllocateTransferStock use case when a transfer allocation command from network-inventory-planning (com.warehouse.wes.network-inventory-planning.transfer.TransferAllocationRequested on warehouse.network-inventory-planning.events) was satisfied: usable stock in the ORIGIN SITE's custody was drawn and a revocable Reservation now holds it, correlated to the transfer line via the transfer_allocations ledger (one row per transfer_line_id, DB-unique — replays return this same event's original outcome without re-deciding).

      Integration topic only (no analytics variant: the Inventory Flow & Accuracy projection has no transfer dimension). Kafka key and CloudEvents subject are the reservation id, so a transfer's replies stay per-reservation ordered (ADR 0021).

      allOf

      CloudEvents envelope for a TransferStockAllocated domain event.

      • #reservation

      Examples

    • #3Transfer Stock Allocation Rejected

      No stock was held for a network transfer line; the closed reason says why.

      Raised by the AllocateTransferStock use case when a transfer allocation command could not be satisfied. reason is a CLOSED set: ORIGIN_SITE_UNKNOWN (no usable stock in the requested origin site's custody — including legacy site-less stock, which is never transfer-allocatable), INSUFFICIENT_USABLE (the origin holds the SKU but not enough usable quantity), IDEMPOTENCY_CONFLICT (the transfer_line_id was replayed with a DIFFERENT command payload; the original ledger decision stands and this reply tells the planner so).

      Integration topic only (no analytics variant). Kafka key and CloudEvents subject are the transfer_line_id — a rejection has no reservation, so the line is the aggregate the reply is about.

      allOf

      CloudEvents envelope for a TransferStockAllocationRejected domain event.

      • #reservation

      Examples

    • #4Transfer Stock Allocation Released

      A transfer cancelled after allocation had its origin hold resolved; the saga settles.

      Raised by the ReleaseTransferAllocation use case (ADR 0051) when a TransferAllocationReleaseRequested command was decided — the compensation leg of the transfer saga, so a stuck or abandoned ALLOCATED transfer never strands its origin reservation until lazy expiry. outcome is a CLOSED set: RELEASED (the reservation still held the stock; this revoked it and returned the quantity to usable), ALREADY_RESOLVED (the reservation had already expired or been confirmed — or the line's allocation was REJECTED, so no hold ever existed; either way the hold is gone). BOTH outcomes settle the saga as success. reason is the command's cancellation reason carried through, or IDEMPOTENCY_CONFLICT on the answer to a conflicting replay (the original ledger decision stands).

      Integration topic only (no analytics variant). Kafka key and CloudEvents subject are the transfer_line_id, mirroring TransferStockAllocationRejected — the release settles the line, so the line is the aggregate the fact is about.

      allOf

      CloudEvents envelope for a TransferStockAllocationReleased domain event (ADR 0051).

      • #reservation

      Examples

    • #5Transfer Receipt Staged

      A destination site counted goods against a recognized ALLOCATED transfer line.

      Raised by the StageTransferReceipt use case (ADR 0033, destination receipt custody — POST /transfers/{transferLineId}/receipt). The transfer_line_id was found in the transfer_allocations ledger with outcome ALLOCATED: a transfer_receipts row (state STAGED, DB-unique on transfer_line_id) now records expected_quantity from the ledger, received_quantity as counted, and the SIGNED variance (received - expected; positive = over, negative = short). Over/short is explicit on the wire, never silently absorbed.

      NO usable stock moves at this step — the destination site's usable rises only when the stow completes (TransferStockStowed). An unrecognized scan is NOT this event: it is quarantined as an inventory_exceptions row and publishes nothing that raises availability.

      Integration topic only (no analytics variant: the Inventory Flow & Accuracy projection has no transfer dimension). Kafka key and CloudEvents subject are the transfer_line_id, so a line's stage-then-stow facts stay ordered on one partition (ADR 0021).

      allOf

      CloudEvents envelope for a TransferReceiptStaged domain event (ADR 0033).

      • #stock

      Examples

    • #6Transfer Stock Stowed

      A staged transfer receipt was placed into destination bins — destination usable rose, exactly once.

      Raised by the StowTransferStock use case (ADR 0033 — POST /transfers/{transferLineId}/stowages): the ONLY path that raises the destination site's usable stock for a transfer. One StockUnit per bin leg was created AT the destination site (NewStockUnitAtSite), every bin verified to belong to that site's custody, the quantities summed exactly to the receipt's received_quantity, and the receipt moved STAGED -> STOWED.

      Idempotent at the database level: a replayed stow for a STOWED receipt returns the original outcome and republishes NOTHING — exactly one of these events exists per transfer_line_id.

      Integration topic only (no analytics variant). Kafka key and CloudEvents subject are the transfer_line_id, matching TransferReceiptStaged so a line's facts stay per-line ordered (ADR 0021).

      allOf

      CloudEvents envelope for a TransferStockStowed domain event (ADR 0033).

      • #stock

      Examples

    • #7Stock Relocated

      A quantity of one SKU moved from one bin to another bin of the same site — on hand unchanged, location changed, exactly once.

      Raised by the RelocateStock use case (ADR 0039), reached two ways: POST /relocations (Idempotency-Key) and the RELOCATE branch of the TaskCompleted consumer (a completed slot-plan RELOCATE task from fulfillment-execution). In ONE transaction the source bin's occupancy fell and the destination bin's rose by quantity, the touched source StockUnits were decremented, ONE new StockUnit was created at to_bin, the immutable relocations row was written and this outbox row enqueued. Site-level on-hand is unchanged.

      Exactly once per relocation: a replayed POST returns the stored response and a redelivered TaskCompleted (same CloudEvents id) is a no-op, so neither publishes again. source_ref is always present ("" when none); on the task path it is the task's relocation_ref, or its task id when the producer sent none. A completed REPLENISH task (ADR 0041) reaches the same use case with reason REPLENISHMENT and source_ref = the task's request_ref (the replenishment request id; required, no task-id fallback), which pick-face-replenishment matches to complete its request.

      Integration topic only (no analytics variant). Kafka key and CloudEvents subject are the relocation id (ADR 0021). slotting-optimization consumes it to close a slot plan's move; it must act only on reason = SLOTTING.

      allOf

      CloudEvents envelope for a StockRelocated domain event (ADR 0039).

      • #stock

      Examples

    • #8Bin Stock Level Changed

      The absolute stock level of one SKU in one bin after a ledger change — on hand, reserved, and a per-(bin, sku) version.

      Raised from the SAME transaction as every ledger change that moves the level of a SKU in a bin (ADR 0040), through the transactional outbox: stow and transfer stow (STOW), a confirmed pick (PICK), a relocation or RELOCATE task (RELOCATE: two events, the source bin then the destination bin), a cycle-count shortfall (COUNT), a reservation or transfer allocation (RESERVE), and a revoked or expired reservation (REVOKE). One event per distinct (bin, sku) per transaction, carrying the FINAL level after the whole transaction: an order whose lines pick the same (bin, sku) raises it once. Nothing is raised when the level did not change (idempotent replays, rejected commands).

      on_hand and reserved are ABSOLUTE levels after the change, never deltas. on_hand is the quantity physically in the bin as the ledger sees it (located, still-present units: units a cycle count marked unlocated, and fully picked-out units, are not counted); reserved is the part of it bound to active reservations, so on_hand - reserved is what a new reservation could still draw from the bin. version is the persisted per-(bin, sku) counter, strictly increasing and gapless across restarts and concurrent changes: a consumer keeps the highest version it has seen for a (bin, sku) and ignores any lower one.

      reason is STOW, PICK, RELOCATE, REPLENISHMENT, COUNT, RESERVE, REVOKE or UNLOCATED; consumers ignore values they do not know. REPLENISHMENT is the reason of a relocation made by a completed REPLENISH task (ADR 0041: two events, the source bin then the destination bin, like RELOCATE), and UNLOCATED is reserved for an unlocated receive with a bin: it is not emitted today (a receive names no bin). A bin whose site cannot be determined (not registered, or neither a recorded site custody nor a facility-layout location code) raises no event. Stock owned by a seller (ADR 0045) has its own level per owner: the optional owner_ref names it and the version counter is per (bin, sku, owner); a consumer that ignores owner_ref sees interleaved levels, so it should key on (bin, sku, owner_ref).

      Integration topic only (no analytics variant). Kafka key and CloudEvents subject are <bin>:<sku>, so every level of one pair lands on one partition in version order (ADR 0021). pick-face-replenishment consumes it to detect a forward pick slot below its minimum.

      allOf

      CloudEvents envelope for a BinStockLevelChanged domain event (ADR 0040).

      • #stock

      Examples

    • #9Discrepancy Detected

      A cycle count found system records did not match physical reality.

      Raised by the RunCycleCount use case when the counted quantity differs from the system quantity for a bin, before reconciliation is applied. A shortfall additionally produces ItemUnlocated events for the quantity that could not be found.

      Published to both topics (promoted to the integration topic 2026-10-21, ADR 0043, for exception-management). Subject = Kafka key = bin id on both topics; data is byte-identical: {bin_id, counted, system}. Only the dataschema stream differs.

      allOf

      CloudEvents envelope for a DiscrepancyDetected domain event.

      • #bin

      Examples

    • #10Item Unlocated

      A physical item's bin is no longer known — the stock is lost.

      Raised by the RunCycleCount use case when a count comes up short: the quantity the system believed was in the bin is not there, so the affected StockUnit quantity is flagged Unlocated and removed from usable. This is the explicit escape hatch for the "every item has exactly one known bin" rule.

      Published to both topics (promoted to the integration topic 2026-10-21, ADR 0043, for exception-management). Subject = stock unit id, Kafka key = SKU on both topics (the split the analytics publisher always used: every fact about one SKU's units stays on one partition while the subject names the lost unit); data is byte-identical: {sku, bin_id, stock_unit_id, quantity}. Only the dataschema stream differs.

      allOf

      CloudEvents envelope for an ItemUnlocated domain event.

      • #stock

      Examples

    • #11Item Stowed

      A quantity of a SKU was placed into a bin.

      Raised by the StowStock use case once BOTH an item scan and a location scan are present — a stow without both is rejected, because skipping either is precisely how inventory gets lost. Chaotic storage applies: any SKU may go into any free bin, provided the bin's capacity is not exceeded. This is the point at which the quantity becomes usable.

      Published to both topics (promoted to the integration topic 2026-10-21, ADR 0043, for returns-processing's restock loop, which does not consume it yet). Subject = Kafka key = SKU on both topics; data is byte-identical: {sku, bin_id, quantity}. Only the dataschema stream differs (...:events: vs ...:analytics:).

      allOf

      CloudEvents envelope for an ItemStowed domain event.

      • #stock

      Examples

    • #12Container Registered

      A sealed carton became a Container (LPN), bounded by its receipt line's booking.

      Raised through the transactional outbox when the Container is created (ADR 0045, 0046): a sealed, single-SKU, Good carton of ReceiptCartonReceived whose receipt line is booked for at least the container quantities so far AND whose GTIN is in the local PackagingView. Either arrival order of the line and the carton gives the same result, at most once per LPN. No quantity is booked by it (StockReceived of ReceiptLineReceived already did, once). Kafka key and subject are the LPN. Integration topic only.

      allOf

      CloudEvents envelope for a ContainerRegistered domain event (ADR 0045).

      • #container

      Examples

    • #13Container Stowed

      A sealed case was stowed into a case bin; its site is the bin's site.

      Raised by StowContainer (ADR 0045) on the first stow and on every move to another bin of the same site. site_id is derived from the bin here (the carton event carries no site, contract R6). The SEALED_CASE stock unit is created at the first stow and its eaches enter the bin occupancy; ItemStowed and BinStockLevelChanged accompany it as for any stow. Kafka key and subject are the LPN.

      allOf

      CloudEvents envelope for a ContainerStowed domain event (ADR 0045).

      • #container

      Examples

    • #14Case Broken

      A sealed case was opened and its eaches moved to loose stock.

      Raised by BreakCase (ADR 0045) in the same transaction that moves exactly qty_eaches (the case's units per pack) from the SEALED_CASE unit to loose stock of the same owner in loose_bin; the ledger total in eaches does not change (conservation). ContainerEmptied follows in the same transaction. owner_ref is an additive field beyond the contract's minimal payload. Kafka key and subject are the LPN.

      allOf

      CloudEvents envelope for a CaseBroken domain event (ADR 0045).

      • #container

      Examples

    • #15Container Emptied

      A container has no contents left; it leaves its bin.

      Raised when a Container reaches EMPTY (ADR 0045): reason is BROKEN (BreakCase) or PICKED (a whole-case reservation was confirmed as picked). Kafka key and subject are the LPN.

      allOf

      CloudEvents envelope for a ContainerEmptied domain event (ADR 0045).

      • #container

      Examples

    • #16Tote Registered

      A reusable tote was registered, empty and in no bin.

      A reusable tote with this license plate exists, empty and in no bin (ADR 0054). Raised once by PUT /totes/{lpn}. The LPN shares one namespace with sealed cases. Kafka key and subject are the LPN.

      allOf

      CloudEvents envelope for a ToteRegistered domain event (ADR 0054).

      • #tote

      Examples

    • #17Tote Filled

      Loose eaches were stowed into a tote at its current bin.

      Loose eaches were stowed into a tote at its current bin (POST /totes/{lpn}/fills, ADR 0054). ItemStowed, LocationRecorded and BinStockLevelChanged accompany it as for any stow; it books no extra quantity.

      allOf

      CloudEvents envelope for a ToteFilled domain event (ADR 0054).

      • #tote

      Examples

    • #18Tote Stowed

      A tote and all its contents now have a new logical location.

      A tote and all its contents now have bin as their logical location (POST /totes/{lpn}/stowages, ADR 0054). from_bin is omitted on the first placement. Moves inside the AS/RS never produce it (WCS seam decision 2). BinStockLevelChanged is raised for both bins.

      allOf

      CloudEvents envelope for a ToteStowed domain event (ADR 0054).

      • #tote

      Examples

    • #19Stock Held

      A received quantity was held out of usable stock.

      Raised when a Damaged receipt line (inbound-receiving ReceiptLineReceived, condition DAMAGED) is booked as held stock instead of being dropped (ADR 0052). The unit has no usable quantity and can never be reserved. It is raised in the same transaction as the consumed message. Kafka key and subject are the held unit id.

      allOf

      CloudEvents envelope for a StockHeld domain event (ADR 0052).

      • #held-stock

      Examples

    • #20Stock Released

      A held quantity was released back to usable stock.

      Raised by a RELEASE disposition (ADR 0052). The quantity re-enters usable stock through the staged-receipt path, so a StockReceived follows in the same transaction; it is usable once stowed. Kafka key and subject are the held unit id.

      allOf

      CloudEvents envelope for a StockReleased domain event (ADR 0052).

      • #held-stock

      Examples

    • #21Stock Dispositioned

      A disposition was decided for a held unit.

      Raised by every disposition decision (ADR 0052): RELEASE, RETURN_TO_VENDOR, SCRAP or REWORK. reason is the hold reason after the decision (a REWORK sets a new one). Kafka key and subject are the held unit id.

      allOf

      CloudEvents envelope for a StockDispositioned domain event (ADR 0052).

      • #held-stock

      Examples

  • SUB warehouse.inventory.analytics

    The internal analytics topic feeding this service's Inventory Flow & Accuracy data product (ADR-0011), the AnalyticsTopic constant in internal/adapters/outbound/kafka/analytics_publisher.go. Same CloudEvents envelope and type strings as the integration topic, but dataschema is urn:warehouse:inventory-storage:analytics:<EventName>:v1 and data is the analytics payload (snake_case, enriched with sku for reservation-lifecycle events). Consumed only by this service's own projector (cmd/inventory-projector), which dispatches on the full type, dedupes on id, and skips (WARN) anything that is not a valid CloudEvent. The legacy ProductClassified never reaches this topic and was retired at product-master ADR 0003 stage E (2026-10-17); the projector would acknowledge it without touching the read model.

    Consume inventory-storage analytics events (internal).

    Internal stream for the analytics projector. CloudEvents 1.0 structured mode with the analytics dataschema; dispatch on the full type, dedupe on id, ignore unknown types.

    Operation IDconsumeInventoryStorageAnalytics

    Available only on servers:

    • #inventory-storage

    Accepts one of the following messages:

    • #0Stock Received

      Goods were received against a SKU and staged, awaiting stow.

      Raised by the ReceiveStock use case when inbound goods are booked in against a SKU. The quantity is staged — it is not yet in a bin and is therefore not usable; it becomes usable only once ItemStowed records the bin it landed in.

      Published to warehouse.inventory.analytics only (subject = SKU, Kafka key = SKU). Analytics data: {sku, quantity}.

      allOf

      CloudEvents envelope for a StockReceived domain event.

      • #stock

      Examples

    • #1Item Stowed

      A quantity of a SKU was placed into a bin.

      Raised by the StowStock use case once BOTH an item scan and a location scan are present — a stow without both is rejected, because skipping either is precisely how inventory gets lost. Chaotic storage applies: any SKU may go into any free bin, provided the bin's capacity is not exceeded. This is the point at which the quantity becomes usable.

      Published to both topics (promoted to the integration topic 2026-10-21, ADR 0043, for returns-processing's restock loop, which does not consume it yet). Subject = Kafka key = SKU on both topics; data is byte-identical: {sku, bin_id, quantity}. Only the dataschema stream differs (...:events: vs ...:analytics:).

      allOf

      CloudEvents envelope for an ItemStowed domain event.

      • #stock

      Examples

    • #2Item Unlocated

      A physical item's bin is no longer known — the stock is lost.

      Raised by the RunCycleCount use case when a count comes up short: the quantity the system believed was in the bin is not there, so the affected StockUnit quantity is flagged Unlocated and removed from usable. This is the explicit escape hatch for the "every item has exactly one known bin" rule.

      Published to both topics (promoted to the integration topic 2026-10-21, ADR 0043, for exception-management). Subject = stock unit id, Kafka key = SKU on both topics (the split the analytics publisher always used: every fact about one SKU's units stays on one partition while the subject names the lost unit); data is byte-identical: {sku, bin_id, stock_unit_id, quantity}. Only the dataschema stream differs.

      allOf

      CloudEvents envelope for an ItemUnlocated domain event.

      • #stock

      Examples

    • #3Stock Reserved

      A quantity was revocably bound to demand.

      Raised by the ReserveStock use case when a reservation is successfully created against usable inventory (on-hand minus active reservations minus held/unlocated stock). The binding is revocable and carries a timeout, so a physical failure downstream never strands the demand.

      Published to both topics. On warehouse.inventory.events (dataschema urn:warehouse:inventory-storage:events:StockReserved:v1) the data payload is the adapter's reservationData shape — sku, quantity, demand_ref — and the reservation id is the CloudEvents subject and the Kafka key. wes-work-planning consumes this exact type to update its UsableInventoryObserved read model by SKU. On warehouse.inventory.analytics (dataschema ...:analytics:StockReserved:v1, Kafka key = reservation id — ADR 0021) data is {sku, reservation_id, quantity}.

      allOf

      CloudEvents envelope for a StockReserved domain event, on both topics; dataschema selects the data shape.

      • #reservation

      Examples

    • #4Stock Picked

      Reserved quantity was physically removed from its bin.

      Raised by the ConfirmPick use case. It consumes the reservation — a reservation cannot be double-consumed — and permanently removes the quantity from on-hand. Grouped under the reservation entity segment because the reservation id is the only identity the event carries.

      Published to warehouse.inventory.analytics only (subject = reservation id, Kafka key = reservation id — ADR 0021). Analytics data: {sku, reservation_id, quantity}.

      allOf

      CloudEvents envelope for a StockPicked domain event.

      • #reservation

      Examples

    • #5Reservation Expired

      A reservation's timeout elapsed before pick confirmation.

      Describes a reservation that timed out without being confirmed or revoked, so its quantity returns to usable. Raised lazily: the Reservation aggregate's IsExpired/Expire() are invoked the next time the reservation is read (GetReservationsByDemandRef, RevokeReservation, ConfirmPick, or ReserveStock's own idempotency lookup), not by a background sweeper — see ADR 0003's "Lazy expiry" section for the full rationale.

      Published to warehouse.inventory.analytics only (subject = Kafka key = reservation id), with the reservation's SKU enriched in: analytics data is {reservation_id, sku}. It does not cross to the integration topic.

      allOf

      CloudEvents envelope for a ReservationExpired domain event.

      • #reservation

      Examples

    • #6Reservation Revoked

      A reservation was cancelled and its quantity returned to usable.

      Raised by the RevokeReservation use case. Revocation is the mechanism that keeps a physical failure — a blocked pod, a lost tote, a chute jam, a short pick — from stranding an order: the quantity goes back to usable and the demand can be re-allocated against a different holding.

      Published to both topics. On warehouse.inventory.events (dataschema urn:warehouse:inventory-storage:events:ReservationRevoked:v1) the domain event carries only the reservation id, so the adapter enriches it through ports.ReservationRepo and emits the same sku / quantity / demand_ref shape as StockReserved; if the lookup finds nothing the publish fails rather than emitting a partial payload. The reservation id is the subject and the Kafka key. wes-work-planning consumes this exact type. On warehouse.inventory.analytics data is {reservation_id, sku}.

      allOf

      CloudEvents envelope for a ReservationRevoked domain event. The data member is enriched by the outbound Kafka adapter, which looks the reservation up through ports.ReservationRepo because the domain event carries only the reservation id.

      • #reservation

      Examples

    • #7Cycle Count Completed

      A bin's contents were verified against system records.

      Raised by the RunCycleCount use case once a bin has been counted and reconciled. The discrepancy flag says whether the counted quantity matched the system quantity; when it did not, a DiscrepancyDetected event and possibly ItemUnlocated events are emitted alongside this one.

      Published to warehouse.inventory.analytics only (subject = bin id, Kafka key = bin id). Analytics data: {bin_id, counted, system, discrepancy}.

      allOf

      CloudEvents envelope for a CycleCountCompleted domain event.

      • #bin

      Examples

    • #8Discrepancy Detected

      A cycle count found system records did not match physical reality.

      Raised by the RunCycleCount use case when the counted quantity differs from the system quantity for a bin, before reconciliation is applied. A shortfall additionally produces ItemUnlocated events for the quantity that could not be found.

      Published to both topics (promoted to the integration topic 2026-10-21, ADR 0043, for exception-management). Subject = Kafka key = bin id on both topics; data is byte-identical: {bin_id, counted, system}. Only the dataschema stream differs.

      allOf

      CloudEvents envelope for a DiscrepancyDetected domain event.

      • #bin

      Examples

  • PUB warehouse.product-master.events

    product-master's integration topic, its Published Language for SKU master data (product-master ADR 0001; the ProductMasterTopic constant in internal/adapters/inbound/kafka/product_master_consumer.go). CONSUMED by this service (ADR 0034), not published: key = SKU, source=/warehouse/product-master, subject = SKU. Only com.warehouse.wms.product-master.product.ProductClassified is acted on, and ProductPackLevelDeclared / ProductPackLevelRetired feed the local PackagingView (ADR 0046); ProductRegistered, ProductDescriptionChanged, ProductDimensionsDeclared and ProductMeasured share the topic and are committed past untouched. The consumer always runs, under the stable group id PRODUCT_MASTER_CONSUMER_GROUP (mandatory, as are DATABASE_URL and KAFKA_BROKERS).

    Apply product-master's ProductClassified to the local copy.

    At-least-once, fixed group: FetchMessage, then CommitMessages only after the handler settles. The CloudEvents id is claimed in processed_events in the SAME transaction as the product_classifications upsert, which applies only when version is greater than the stored version (a missing row is inserted; legacy rows carry version 0). A transient database error retries the same message with capped backoff; a message that is not a valid CloudEvent, has an undecodable payload or breaks the classification invariants is logged and committed past. Nothing is published in response (no loop back to product-master).

    Operation IDapplyProductMasterClassification

    Available only on servers:

    • #product-master

    Accepts one of the following messages:

    • #0Product Classified (from product-master, consumed)

      product-master's full-state classification of a SKU, with its product version.

      CONSUMED, not produced (ADR 0034). Pinned by product-master's apis/asyncapi.yaml: type com.warehouse.wms.product-master.product.ProductClassified, source=/warehouse/product-master, subject and Kafka key = SKU. data is the full classification plus classification_source (native | legacy-import) and the product version; this service applies a message only when version is greater than the version it stores for the SKU. temperature_class and dot_hazard_class are omitted when unset.

      object

      CloudEvents 1.0 envelope of product-master's ProductClassified as consumed here (not composed from CloudEventBase, whose source is this service's own).

      • #product-master

      Examples

    • #1Product Pack Level Declared (from product-master, consumed)

      A pack level (EACH, INNER, CASE, PALLET) of a SKU with its GTIN and units per pack.

      CONSUMED, not produced (ADR 0046, contract R8): type com.warehouse.wms.product-master.product.ProductPackLevelDeclared, source=/warehouse/product-master, subject and Kafka key = SKU. Projected into the local PackagingView, keyed by GTIN and by (sku, level); an event applies only when its product version is not older than the stored one, and the CloudEvents id is claimed in processed_events (consumer product-master-pack-level). A newly known GTIN settles the cartons that were waiting for it. Unknown fields are ignored.

      object

      CloudEvents 1.0 envelope of ProductPackLevelDeclared as consumed here (not composed from CloudEventBase, whose source is this service's own).

      • #product-master

      Examples

    • #2Product Pack Level Retired (from product-master, consumed)

      A pack level stops being in force from a date; its GTIN stays resolvable.

      CONSUMED, not produced (ADR 0046, contract R8): type com.warehouse.wms.product-master.product.ProductPackLevelRetired. End-dates the level of gtin in the PackagingView (effective_to); the GTIN remains resolvable so cartons labelled with it still link. Applied when version is not older than the stored one; an unknown GTIN is a no-op.

      object

      CloudEvents 1.0 envelope of ProductPackLevelRetired as consumed here (not composed from CloudEventBase, whose source is this service's own).

      • #product-master

      Examples

  • PUB warehouse.facility.events

    facility-layout's integration topic. Consumed ONLY for the four types the facility cache dispatches on (ADR 0024 / this repo's ADR 0047): ZoneRegistered (zone classification: temperature + hazmat, for stow legality), LocationSlotRegistered (slot existence, zone and optional handling unit), LocationSlotDecommissioned (evict the slot; the stow check then fails open for it) and LocationSlotHandlingUnitDeclared (set/change a bin's handling unit, ADR 0040). The consumer rebuilds an in-memory cache from the topic's FULL history on every start (offset reset to the first offset) under a dedicated PER-PROCESS consumer group inventory-storage-facility-location-cache-<host>-<pid>-<nanos> (deliberately not configurable and not shared: there is no FACILITY_CONSUMER_GROUP); last write wins per subject (same partition). A message that is not a valid CloudEvent, has an undecodable payload or lacks a required field is written to warehouse.facility.events.dlq and the consumer carries on.

    Apply facility-layout's published language to the facility cache.

    Upserts/evicts rows of the in-memory facility cache (no database and no processed_events claim: the cache is rebuilt by replaying the topic from the beginning on every start); last write wins per subject. A malformed message is dead-lettered to warehouse.facility.events.dlq and skipped.

    Operation IDapplyFacilityCache

    Available only on servers:

    Accepts one of the following messages:

    • #0ZoneRegistered (from facility-layout, consumed)

      A zone and its classification (temperature, hazmat) was registered.

      CONSUMED, not produced. Pinned by facility-layout's apis/asyncapi.yaml: type com.warehouse.wms.facility-layout.zone.ZoneRegistered, source=/warehouse/facility-layout, subject and Kafka key = the zoneId. Only the fields the facility cache relies on are listed; the producer's own AsyncAPI is authoritative and unknown fields are ignored.

      object

      CloudEvents 1.0 envelope of facility-layout's ZoneRegistered as consumed here (not composed from CloudEventBase, whose source is this service's own).

      • #facility-layout

      Examples

    • #1LocationSlotRegistered (from facility-layout, consumed)

      A coded storage slot was registered, with its zone and optional handling unit.

      CONSUMED, not produced. Pinned by facility-layout's apis/asyncapi.yaml: type com.warehouse.wms.facility-layout.locationslot.LocationSlotRegistered, source=/warehouse/facility-layout, subject and Kafka key = the locationCode. Only the fields the facility cache relies on are listed; the producer's own AsyncAPI is authoritative and unknown fields are ignored. locationType is read (ADR 0054): a bin of type AutomatedStorage takes container stock only.

      object

      CloudEvents 1.0 envelope of facility-layout's LocationSlotRegistered as consumed here (not composed from CloudEventBase, whose source is this service's own).

      • #facility-layout

      Examples

    • #2LocationSlotDecommissioned (from facility-layout, consumed)

      A coded slot was permanently retired.

      CONSUMED, not produced. Pinned by facility-layout's apis/asyncapi.yaml: type com.warehouse.wms.facility-layout.locationslot.LocationSlotDecommissioned, source=/warehouse/facility-layout, subject and Kafka key = the locationCode. Only the fields the facility cache relies on are listed; the producer's own AsyncAPI is authoritative and unknown fields are ignored.

      object

      CloudEvents 1.0 envelope of facility-layout's LocationSlotDecommissioned as consumed here (not composed from CloudEventBase, whose source is this service's own).

      • #facility-layout

      Examples

    • #3LocationSlotHandlingUnitDeclared (from facility-layout, consumed)

      A slot's handling unit (EACH, CASE or PALLET) was set or changed (ADR 0040).

      CONSUMED, not produced. Pinned by facility-layout's apis/asyncapi.yaml: type com.warehouse.wms.facility-layout.locationslot.LocationSlotHandlingUnitDeclared, source=/warehouse/facility-layout, subject and Kafka key = the locationCode. Only the fields the facility cache relies on are listed; the producer's own AsyncAPI is authoritative and unknown fields are ignored.

      object

      CloudEvents 1.0 envelope of facility-layout's LocationSlotHandlingUnitDeclared as consumed here (not composed from CloudEventBase, whose source is this service's own).

      • #facility-layout

      Examples

  • PUB warehouse.slotting-optimization.events

    slotting-optimization's integration topic. Consumed ONLY for SlotPlanApproved (key and subject = the plan id); SlotPlanGenerated and SlotPlanRejected are committed past (ADR 0050). The consumer always runs, under the group SLOT_PLAN_CONSUMER_GROUP (default inventory-storage-slot-plan), and replays the topic from the first offset for a new group.

    Apply slotting-optimization's approved forward-slot map to the local forward-face read model.

    At-least-once, fixed group. The CloudEvents id is claimed in processed_events in the SAME transaction as the replacement of the site's forward_pick_faces (assignments is the FULL map of the site: it replaces the site's previous map wholesale). A plan applies only when its approved_at is later than the held plan's, or equal with a higher plan_id; an older plan delivered late is ignored. A message that is not a valid CloudEvent, has an undecodable payload, or lacks the plan id, site, approval time, or a SKU or slot is logged and committed past. Nothing is published in response. ReserveStock reads the read model to draw a SKU's forward pick face before its reserve bins.

    Operation IDapplySlotPlanApproved

    Available only on servers:

    • #slotting-optimization

    Accepts the following message:

    SlotPlanApproved (from slotting-optimization, consumed)

    A slot plan was approved; its FULL assignment map is the site's forward pick faces (ADR 0050).

    CONSUMED, not produced. Pinned by slotting-optimization's apis/asyncapi.yaml on develop: type com.warehouse.wms.slotting-optimization.slotplan.SlotPlanApproved, source=/warehouse/slotting-optimization, subject and Kafka key = the plan id. Only plan_id, site_id, approved_at and assignments[].{sku, slot} are read; moves, supersedes_plan_id, pick_unit and cases_capacity are ignored. The consumer is consumer-first safe: it only reads what slotting already publishes, so no producer change is required.

    object

    CloudEvents 1.0 envelope of slotting-optimization's SlotPlanApproved as consumed here (not composed from CloudEventBase, whose source is this service's own).

    • #slotting-optimization

    Examples

  • PUB warehouse.fulfillment.events

    fulfillment-execution's integration topic, its Published Language for task facts (the FulfillmentTopic constant in internal/adapters/inbound/kafka/task_completed_consumer.go). CONSUMED by this service (ADR 0035), not published: key = subject = task id, source=/warehouse/fulfillment-execution. Only com.warehouse.wes.fulfillment-execution.task.TaskCompleted is acted on (task_type PICK, ADR 0035/0036, and RELOCATE, ADR 0039); TaskCPTMissed, PackageManifested and the Transfer* facts share the topic and are committed past untouched. The consumer always runs (ADR 0042), under the stable group TASK_COMPLETED_CONSUMER_GROUP (mandatory, as are DATABASE_URL and KAFKA_BROKERS; chart default inventory-storage-confirm-pick). Poison messages and messages whose handling kept failing are written to warehouse.fulfillment.events.dlq.

    Confirm the picked line's reservation (line_no), or fall back to confirming the order on its last TaskCompleted; apply a completed RELOCATE task as an intra-site stock move.

    At-least-once, fixed group: FetchMessage, then CommitMessages only after the message settles. For task_type = PICK with a non-empty order_ref (the OrderId order-management reserved against, stored here as demand_ref) there are two paths.

    PER-LINE (ADR 0036, audit decision 18): when the event carries the additive line_no, exactly the ACTIVE reservation(s) with demand_ref = order_ref and line_no equal to the event's are confirmed through the existing ConfirmPick logic (stock decremented, bin capacity released, StockPicked raised); normally exactly one, since earlier attempts of the line are REVOKED. CONFIRMED and REVOKED ones are skipped; an EXPIRED one (ADR 0003) is skipped, logged and counted (inventory.pick_confirmations{outcome=expired}), never an error. Other lines of the order are never touched, so a line whose pick has not arrived stays ACTIVE and reserved. Nothing is counted on this path (no order_pick_progress row).

    COUNTING FALLBACK (ADR 0035, kept for backward compatibility): when the event has no line_no, or names a line that no reservation of the order carries but the order has reservations created before line_no existed (NULL), the pick is COUNTED for the order (table order_pick_progress) against those reservations only; when the count reaches their ACTIVE + CONFIRMED number (REVOKED and EXPIRED are not awaited), i.e. on the LAST pick, every ACTIVE one is confirmed. Earlier picks only record progress and settle as successful no-ops. Counter rows older than ORDER_PICK_PROGRESS_RETENTION (default 720h) are swept. The "one pick early" edge of that counting does not exist on the per-line path.

    The CloudEvents id claim in processed_events, the counter increment (fallback only) and all confirmations commit in ONE transaction, so a failure rolls everything back and the redelivery is applied in full; a redelivered id is a no-op, and a further PICK event for an already confirmed line confirms nothing new. No reservations for the order (a transfer or non-inventory order), a line with no reservation and no line-less ones to fall back to, a non-PICK task, a missing order_ref (a producer that predates the field) and every other event type are successful no-ops. A Task carries no SKU or quantity, so SHORT PICKS ARE NOT MODELLED. A line_no that is not an integer between 1 and 2147483647 is a malformed payload: dead-lettered at once.

    RELOCATE (ADR 0039, decision E1): a task_type = RELOCATE completion carries the additive sku, from_bin, to_bin, quantity and relocation_ref and is applied by ApplyRelocationTask, never by confirm-pick: the same RelocateStock as POST /relocations (reason SLOTTING, site = the source bin's site, source_ref = relocation_ref or the task id) moves the stock and enqueues StockRelocated, with the CloudEvents id claimed in processed_events under consumer task-completed-relocate in the SAME transaction, so a redelivery is a no-op and a failure un-claims the id. A completion that can never apply (a missing or invalid field, an unknown bin, bins of different sites, the same bin, too little usable stock, a full destination) is dead-lettered at once; a transient failure (database, concurrent modification) is retried; a shutdown mid-move commits nothing and dead-letters nothing.

    REPLENISH (ADR 0041): a task_type = REPLENISH completion carries the same additive sku, from_bin, to_bin, quantity plus the REQUIRED request_ref (the pick-face-replenishment request id, mirroring relocation_ref) and is applied by ApplyReplenishTask: the same RelocateStock with reason REPLENISHMENT, site = the source bin's site and source_ref = request_ref (no task-id fallback: the replenishment context closes a request by source_ref == request_id). It enqueues StockRelocated plus the two BinStockLevelChanged events (reason REPLENISHMENT, source bin then destination bin). The CloudEvents id is claimed in processed_events under consumer task-completed-replenish in the SAME transaction; classification of deterministic versus transient failures is that of RELOCATE, and a REPLENISH completion without request_ref is dead-lettered at once.

    A transient failure retries the same message with capped backoff (5 attempts), then dead-letters it; an undecodable payload is dead-lettered at once; a message that is not a CloudEvent is skipped with a sampled WARN.

    Operation IDconfirmPicksFromTaskCompleted

    Available only on servers:

    • #fulfillment-execution

    Accepts the following message:

    Task Completed (from fulfillment-execution, consumed)

    A station finished a claimed task; a PICK task makes this service confirm the picked line's reservation (or, without a line, the order's on its last pick).

    CONSUMED, not produced (ADR 0035, ADR 0036). Pinned by fulfillment-execution's apis/asyncapi.yaml: type com.warehouse.wes.fulfillment-execution.task.TaskCompleted, source=/warehouse/fulfillment-execution, subject and Kafka key = task id. This service reads only task_id, task_type, order_ref, line_no and, on RELOCATE and REPLENISH tasks, sku, from_bin, to_bin, quantity and relocation_ref (RELOCATE) or request_ref (REPLENISH); every other field (station_id, work_unit_id, associate_id, duration_seconds) is ignored. order_ref is the additive optional field of ADR 0035 (v1, omitted when empty): the task's order reference, i.e. the OrderId order-management used as demand_ref. line_no is the additive optional field of ADR 0036 (v1, omitted when unknown): the order line the task was for. A message without order_ref, or with any task_type other than PICK, RELOCATE or REPLENISH, is a successful no-op; one without line_no takes the ADR 0035 counting path. The RELOCATE fields are the additive fields of ADR 0039 (decision E1, v1): fulfillment-execution sends them on RELOCATE tasks only, and a RELOCATE completion is applied as an intra-site move (StockRelocated). request_ref is the additive field of ADR 0041 (v1): REPLENISH tasks only, the replenishment request id, required on a REPLENISH completion; such a completion is applied as an intra-site move with reason REPLENISHMENT.

    object

    CloudEvents 1.0 envelope of fulfillment-execution's TaskCompleted v1 as consumed here (not composed from CloudEventBase, whose source is this service's own). Only the fields this service reads are listed under data; the producer sends more.

    • #fulfillment-execution

    Examples

  • PUB warehouse.inbound-receiving.events

    inbound-receiving's integration topic, its Published Language for ASNs, dock appointments and receipts (inbound-receiving ADR 0003; the InboundReceivingTopic constant in internal/adapters/inbound/kafka/inbound_receipt_consumer.go). CONSUMED by this service (ADR 0037), not published: key = ASN number, source=/warehouse/inbound-receiving, subject = the receipt id. Only com.warehouse.wms.inbound-receiving.receipt.ReceiptLineReceived is acted on, and ReceiptCartonReceived creates or links Containers (ADR 0045, 0046; it never books a quantity); ASNRegistered, ASNCancelled, DockAppointment*, ReceiptOpened and ReceiptClosed share the topic and are committed past untouched. The consumer always runs, under the stable group id INBOUND_RECEIPT_CONSUMER_GROUP (mandatory, as are DATABASE_URL and KAFKA_BROKERS).

    Book a received Good line as a staged receipt.

    At-least-once, fixed group: FetchMessage, then CommitMessages only after the handler settles. For condition=Good the CloudEvents id is claimed in processed_events (consumer inbound-receipt-line) in the SAME transaction as the existing ReceiveStock use case, which raises StockReceived through the outbox (analytics topic): the units are staged and not yet usable, and stow stays the RF action (item scan plus location scan). POST /stock-receipts is unchanged and keeps working for ad-hoc receipts. condition=Damaged is booked as HELD stock (ADR 0052), not dropped: in the same transaction it raises StockHeld through the outbox and is counted in inventory.inbound_receipt_units{outcome=held}. A held unit has no usable quantity and can never be reserved until a disposition (RELEASE, RETURN_TO_VENDOR, SCRAP, REWORK) settles it. A redelivered id is a no-op. A transient failure retries the same message with capped backoff; a message that is not a valid CloudEvent, has an undecodable payload, an empty sku, a non-positive quantity or an unknown condition is logged (WARN) and committed past.

    Operation IDbookInboundReceiptLine

    Available only on servers:

    • #inbound-receiving

    Accepts one of the following messages:

    • #0Receipt Line Received (from inbound-receiving, consumed)

      A quantity was received against an ASN line at the dock; Good units are booked as staged stock here.

      CONSUMED, not produced (ADR 0037). Pinned by inbound-receiving's apis/asyncapi.yaml (the handover event of its ADR 0003): type com.warehouse.wms.inbound-receiving.receipt.ReceiptLineReceived, source=/warehouse/inbound-receiving, subject = the receipt id, Kafka key = the ASN number. data is snake_case: {receipt_id, asn_number, line_no, sku, quantity, condition, received_at} with condition one of Good or Damaged. This service books sku and quantity of a Good line through ReceiveStock (its own clock stamps the resulting StockReceived; received_at, receipt_id, asn_number and line_no are logged, not stored) and does not book a Damaged line.

      object

      CloudEvents 1.0 envelope of inbound-receiving's ReceiptLineReceived v1 as consumed here (not composed from CloudEventBase, whose source is this service's own).

      • #inbound-receiving

      Examples

    • #1Receipt Carton Received (from inbound-receiving, consumed)

      A sealed carton was received on a receipt line; it becomes a Container once the line is booked.

      CONSUMED, not produced (ADR 0045, 0046; contract section 2 with R6/R7 applied): type com.warehouse.wms.inbound-receiving.receipt.ReceiptCartonReceived, source=/warehouse/inbound-receiving. data is snake_case: {receipt_id, asn_number, sscc, parent_sscc, sealed, lpn, owner_ref, contents[{line_no, sku, gtin, qty, lot, expiry, condition}], received_at}. It carries NO site (R6): the container's site is derived at StowContainer from the bin. Unknown fields are ignored.

      Only a sealed, single-content, Good carton whose qty equals the case's units per pack in the PackagingView gets a Container (mixed, unsealed and damaged cartons keep their eaches as ordinary staged stock and get none). The carton is recorded keyed by (receipt_id, line_no, lpn) and settles idempotently in either arrival order relative to ReceiptLineReceived: the container exists only when the sum of container quantities of the line stays within the eaches ReceiptLineReceived booked, and when gtin is known to the PackagingView (otherwise it waits in the pending table). This message books NO quantity. The CloudEvents id is claimed in processed_events (consumer inbound-carton) in the same transaction.

      object

      CloudEvents 1.0 envelope of ReceiptCartonReceived as consumed here (not composed from CloudEventBase, whose source is this service's own).

      • #inbound-receiving

      Examples

  • PUB warehouse.returns-processing.events

    returns-processing's integration topic, its Published Language for the reverse flow of goods (returns-processing ADR 0001; the ReturnsProcessingTopic constant in internal/adapters/inbound/kafka/return_line_consumer.go). CONSUMED by this service (ADR 0044), not published: key and subject = the disposition id, source=/warehouse/returns-processing. Only com.warehouse.wms.returns-processing.disposition.ReturnLineStaged is acted on (the RESTOCK disposition's handover); ReturnAuthorized, ReturnAuthorizationRejected, the ReturnReceipt* types, UnexpectedReturnReceived and DispositionDecided share the topic and are committed past untouched. The consumer always runs, under the stable group id RETURN_LINE_CONSUMER_GROUP (mandatory, as are DATABASE_URL and KAFKA_BROKERS).

    Book a staged return line as a staged receipt.

    At-least-once, fixed group: FetchMessage, then CommitMessages only after the handler settles. The CloudEvents id is claimed in processed_events (consumer return-line-staged, the flow's provenance record — the mirror of inbound-receipt-line) in the SAME transaction as the existing ReceiveStock use case — the SAME staged-receipt seam an inbound receipt line and POST /stock-receipts drive — which raises StockReceived through the outbox (analytics topic): the units are staged and not yet usable, and stow stays the RF action (item scan plus location scan). Return context (receipt_id, rma_id, disposition_id, site_id, received_at) is logged, never stored on the stock event. A redelivered id is a no-op. A transient failure retries the same message with capped backoff; a message that is not a valid CloudEvent, has an undecodable payload, an empty sku, a non-positive quantity, an empty disposition_id or a condition other than the constant Good is logged (WARN) and committed past.

    Operation IDbookReturnLine

    Available only on servers:

    • #returns-processing

    Accepts the following message:

    Return Line Staged (from returns-processing, consumed)

    A RESTOCK disposition hands restockable units back as a staged receipt line.

    CONSUMED, not produced (ADR 0044). Pinned by returns-processing's apis/asyncapi.yaml: type com.warehouse.wms.returns-processing.disposition.ReturnLineStaged, source=/warehouse/returns-processing, subject and Kafka key = the disposition id. data is inbound-receiving's ReceiptLineReceived fields plus rma_id, disposition_id and site_id: {receipt_id, line_no, sku, quantity, condition, received_at, rma_id, disposition_id, site_id} with condition the constant Good (only a RESTOCK disposition stages a line). This service books sku and quantity through the SAME ReceiveStock use case as a receipt line (its own clock stamps the resulting StockReceived; the return context is logged, not stored), so the units are staged and not yet usable until stow.

    object

    CloudEvents 1.0 envelope of returns-processing's ReturnLineStaged v1 as consumed here (not composed from CloudEventBase, whose source is this service's own).

    • #returns-processing

    Examples

  • PUB warehouse.network-inventory-planning.events

    network-inventory-planning's integration topic, its Published Language for transfer commands (the Topic constant in internal/adapters/inbound/kafka/transfer_consumer.go). CONSUMED by this service (ADR 0030, ADR 0050), not published: key and subject = the transfer line id, source=/warehouse/network-inventory-planning. Only com.warehouse.wes.network-inventory-planning.transfer.TransferAllocationRequested and com.warehouse.wes.network-inventory-planning.transfer.TransferAllocationReleaseRequested (the cancel-after-allocation compensation command, ADR 0050) are acted on; every other CloudEvents type on the topic is ignored. The consumer always runs (ADR 0042), under the stable group TRANSFER_ALLOCATION_CONSUMER_GROUP (mandatory, as are DATABASE_URL and KAFKA_BROKERS; chart default inventory-storage-transfer-allocation).

    Apply the transfer-allocation and transfer-release commands and reply through the outbox.

    At-least-once, fixed group: FetchMessage, then CommitMessages only after the handler settles; a transient error retries the SAME message with capped backoff (200ms to 5s), so a failed handler can never drop or skip a command. A payload that can never be applied (an undecodable payload, an invalid origin_site_id, an empty sku, a non-positive quantity, a release naming a transfer line this service never decided, or a release disagreeing with the allocation ledger) is logged (WARN) and committed past; there is no DLQ on this topic. The replies — TransferStockAllocated, TransferStockAllocationRejected, or TransferStockAllocationReleased — are published on this service's own integration topic through the transactional outbox, never back onto the command topic.

    Operation IDapplyTransferCommands

    Available only on servers:

    • #network-inventory-planning

    Accepts one of the following messages:

    • #0Transfer Allocation Requested (from network-inventory-planning, consumed)

      network-inventory-planning asked this context to allocate origin stock for a transfer line.

      CONSUMED command, not produced (ADR 0030). Pinned by network-inventory-planning's apis/asyncapi.yaml: type com.warehouse.wes.network-inventory-planning.transfer.TransferAllocationRequested, source=/warehouse/network-inventory-planning, subject and Kafka key = the transfer line id. data is exactly five fields — the whole consumed contract; this service replies with TransferStockAllocated or TransferStockAllocationRejected on its own integration topic.

      object

      CloudEvents 1.0 envelope of network-inventory-planning's TransferAllocationRequested command as consumed here (not composed from CloudEventBase, whose source is this service's own).

      • #network-inventory-planning

      Examples

    • #1Transfer Allocation Release Requested (from network-inventory-planning, consumed)

      network-inventory-planning cancelled a transfer AFTER allocation and asked this context to release the origin hold.

      CONSUMED command, not produced (ADR 0050 — the compensation leg that closes the saga's cancel-after-allocation gap). Pinned by network-inventory-planning's apis/asyncapi.yaml: type com.warehouse.wes.network-inventory-planning.transfer.TransferAllocationReleaseRequested, source=/warehouse/network-inventory-planning, subject and Kafka key = the transfer line id. data is exactly seven fields — the whole consumed contract; this service replies with TransferStockAllocationReleased on its own integration topic. Idempotent by transfer_line_id through the transfer_allocation_releases ledger: a byte-identical replay returns the original outcome untouched, a conflicting payload is answered with the original outcome and reason IDEMPOTENCY_CONFLICT. A command naming a line this service never decided, or disagreeing with the allocation ledger, is a deterministic refusal — logged and committed past, no event.

      object

      CloudEvents 1.0 envelope of network-inventory-planning's TransferAllocationReleaseRequested command as consumed here (ADR 0050; not composed from CloudEventBase, whose source is this service's own).

      • #network-inventory-planning

      Examples

Messages

  • #1Stock Received

    Goods were received against a SKU and staged, awaiting stow.

    Message IDStockReceived

    Raised by the ReceiveStock use case when inbound goods are booked in against a SKU. The quantity is staged — it is not yet in a bin and is therefore not usable; it becomes usable only once ItemStowed records the bin it landed in.

    Published to warehouse.inventory.analytics only (subject = SKU, Kafka key = SKU). Analytics data: {sku, quantity}.

    allOf

    CloudEvents envelope for a StockReceived domain event.

    • #stock
  • #2Item Stowed

    A quantity of a SKU was placed into a bin.

    Message IDItemStowed

    Raised by the StowStock use case once BOTH an item scan and a location scan are present — a stow without both is rejected, because skipping either is precisely how inventory gets lost. Chaotic storage applies: any SKU may go into any free bin, provided the bin's capacity is not exceeded. This is the point at which the quantity becomes usable.

    Published to both topics (promoted to the integration topic 2026-10-21, ADR 0043, for returns-processing's restock loop, which does not consume it yet). Subject = Kafka key = SKU on both topics; data is byte-identical: {sku, bin_id, quantity}. Only the dataschema stream differs (...:events: vs ...:analytics:).

    allOf

    CloudEvents envelope for an ItemStowed domain event.

    • #stock
  • #3Location Recorded

    A bin now authoritatively holds a given StockUnit.

    Message IDLocationRecorded

    Raised by the StowStock use case immediately after ItemStowed. It binds a StockUnit id to a bin id, which is the invariant this whole bounded context exists to protect: every physical item has exactly one known bin, or is explicitly flagged Unlocated.

    In-process only — not published to any Kafka topic. Documented as part of the domain-event catalog.

    allOf

    CloudEvents envelope for a LocationRecorded domain event.

    • #stock
  • #4ZoneRegistered (from facility-layout, consumed)

    A zone and its classification (temperature, hazmat) was registered.

    Message IDFacilityLayoutZoneRegistered

    CONSUMED, not produced. Pinned by facility-layout's apis/asyncapi.yaml: type com.warehouse.wms.facility-layout.zone.ZoneRegistered, source=/warehouse/facility-layout, subject and Kafka key = the zoneId. Only the fields the facility cache relies on are listed; the producer's own AsyncAPI is authoritative and unknown fields are ignored.

    object

    CloudEvents 1.0 envelope of facility-layout's ZoneRegistered as consumed here (not composed from CloudEventBase, whose source is this service's own).

    • #facility-layout
  • #5LocationSlotRegistered (from facility-layout, consumed)

    A coded storage slot was registered, with its zone and optional handling unit.

    Message IDFacilityLayoutLocationSlotRegistered

    CONSUMED, not produced. Pinned by facility-layout's apis/asyncapi.yaml: type com.warehouse.wms.facility-layout.locationslot.LocationSlotRegistered, source=/warehouse/facility-layout, subject and Kafka key = the locationCode. Only the fields the facility cache relies on are listed; the producer's own AsyncAPI is authoritative and unknown fields are ignored. locationType is read (ADR 0054): a bin of type AutomatedStorage takes container stock only.

    object

    CloudEvents 1.0 envelope of facility-layout's LocationSlotRegistered as consumed here (not composed from CloudEventBase, whose source is this service's own).

    • #facility-layout
  • #6LocationSlotDecommissioned (from facility-layout, consumed)

    A coded slot was permanently retired.

    Message IDFacilityLayoutLocationSlotDecommissioned

    CONSUMED, not produced. Pinned by facility-layout's apis/asyncapi.yaml: type com.warehouse.wms.facility-layout.locationslot.LocationSlotDecommissioned, source=/warehouse/facility-layout, subject and Kafka key = the locationCode. Only the fields the facility cache relies on are listed; the producer's own AsyncAPI is authoritative and unknown fields are ignored.

    object

    CloudEvents 1.0 envelope of facility-layout's LocationSlotDecommissioned as consumed here (not composed from CloudEventBase, whose source is this service's own).

    • #facility-layout
  • #7LocationSlotHandlingUnitDeclared (from facility-layout, consumed)

    A slot's handling unit (EACH, CASE or PALLET) was set or changed (ADR 0040).

    Message IDFacilityLayoutLocationSlotHandlingUnitDeclared

    CONSUMED, not produced. Pinned by facility-layout's apis/asyncapi.yaml: type com.warehouse.wms.facility-layout.locationslot.LocationSlotHandlingUnitDeclared, source=/warehouse/facility-layout, subject and Kafka key = the locationCode. Only the fields the facility cache relies on are listed; the producer's own AsyncAPI is authoritative and unknown fields are ignored.

    object

    CloudEvents 1.0 envelope of facility-layout's LocationSlotHandlingUnitDeclared as consumed here (not composed from CloudEventBase, whose source is this service's own).

    • #facility-layout
  • #8SlotPlanApproved (from slotting-optimization, consumed)

    A slot plan was approved; its FULL assignment map is the site's forward pick faces (ADR 0050).

    Message IDSlottingSlotPlanApproved

    CONSUMED, not produced. Pinned by slotting-optimization's apis/asyncapi.yaml on develop: type com.warehouse.wms.slotting-optimization.slotplan.SlotPlanApproved, source=/warehouse/slotting-optimization, subject and Kafka key = the plan id. Only plan_id, site_id, approved_at and assignments[].{sku, slot} are read; moves, supersedes_plan_id, pick_unit and cases_capacity are ignored. The consumer is consumer-first safe: it only reads what slotting already publishes, so no producer change is required.

    object

    CloudEvents 1.0 envelope of slotting-optimization's SlotPlanApproved as consumed here (not composed from CloudEventBase, whose source is this service's own).

    • #slotting-optimization
  • #9Product Classified (from product-master, consumed)

    product-master's full-state classification of a SKU, with its product version.

    Message IDProductMasterProductClassified

    CONSUMED, not produced (ADR 0034). Pinned by product-master's apis/asyncapi.yaml: type com.warehouse.wms.product-master.product.ProductClassified, source=/warehouse/product-master, subject and Kafka key = SKU. data is the full classification plus classification_source (native | legacy-import) and the product version; this service applies a message only when version is greater than the version it stores for the SKU. temperature_class and dot_hazard_class are omitted when unset.

    object

    CloudEvents 1.0 envelope of product-master's ProductClassified as consumed here (not composed from CloudEventBase, whose source is this service's own).

    • #product-master
  • #10Container Registered

    A sealed carton became a Container (LPN), bounded by its receipt line's booking.

    Message IDContainerRegistered

    Raised through the transactional outbox when the Container is created (ADR 0045, 0046): a sealed, single-SKU, Good carton of ReceiptCartonReceived whose receipt line is booked for at least the container quantities so far AND whose GTIN is in the local PackagingView. Either arrival order of the line and the carton gives the same result, at most once per LPN. No quantity is booked by it (StockReceived of ReceiptLineReceived already did, once). Kafka key and subject are the LPN. Integration topic only.

    allOf

    CloudEvents envelope for a ContainerRegistered domain event (ADR 0045).

    • #container
  • #11Container Stowed

    A sealed case was stowed into a case bin; its site is the bin's site.

    Message IDContainerStowed

    Raised by StowContainer (ADR 0045) on the first stow and on every move to another bin of the same site. site_id is derived from the bin here (the carton event carries no site, contract R6). The SEALED_CASE stock unit is created at the first stow and its eaches enter the bin occupancy; ItemStowed and BinStockLevelChanged accompany it as for any stow. Kafka key and subject are the LPN.

    allOf

    CloudEvents envelope for a ContainerStowed domain event (ADR 0045).

    • #container
  • #12Case Broken

    A sealed case was opened and its eaches moved to loose stock.

    Message IDCaseBroken

    Raised by BreakCase (ADR 0045) in the same transaction that moves exactly qty_eaches (the case's units per pack) from the SEALED_CASE unit to loose stock of the same owner in loose_bin; the ledger total in eaches does not change (conservation). ContainerEmptied follows in the same transaction. owner_ref is an additive field beyond the contract's minimal payload. Kafka key and subject are the LPN.

    allOf

    CloudEvents envelope for a CaseBroken domain event (ADR 0045).

    • #container
  • #13Container Emptied

    A container has no contents left; it leaves its bin.

    Message IDContainerEmptied

    Raised when a Container reaches EMPTY (ADR 0045): reason is BROKEN (BreakCase) or PICKED (a whole-case reservation was confirmed as picked). Kafka key and subject are the LPN.

    allOf

    CloudEvents envelope for a ContainerEmptied domain event (ADR 0045).

    • #container
  • #14Tote Registered

    A reusable tote was registered, empty and in no bin.

    Message IDToteRegistered

    A reusable tote with this license plate exists, empty and in no bin (ADR 0054). Raised once by PUT /totes/{lpn}. The LPN shares one namespace with sealed cases. Kafka key and subject are the LPN.

    allOf

    CloudEvents envelope for a ToteRegistered domain event (ADR 0054).

    • #tote
  • #15Tote Filled

    Loose eaches were stowed into a tote at its current bin.

    Message IDToteFilled

    Loose eaches were stowed into a tote at its current bin (POST /totes/{lpn}/fills, ADR 0054). ItemStowed, LocationRecorded and BinStockLevelChanged accompany it as for any stow; it books no extra quantity.

    allOf

    CloudEvents envelope for a ToteFilled domain event (ADR 0054).

    • #tote
  • #16Tote Stowed

    A tote and all its contents now have a new logical location.

    Message IDToteStowed

    A tote and all its contents now have bin as their logical location (POST /totes/{lpn}/stowages, ADR 0054). from_bin is omitted on the first placement. Moves inside the AS/RS never produce it (WCS seam decision 2). BinStockLevelChanged is raised for both bins.

    allOf

    CloudEvents envelope for a ToteStowed domain event (ADR 0054).

    • #tote
  • #17Stock Held

    A received quantity was held out of usable stock.

    Message IDStockHeld

    Raised when a Damaged receipt line (inbound-receiving ReceiptLineReceived, condition DAMAGED) is booked as held stock instead of being dropped (ADR 0052). The unit has no usable quantity and can never be reserved. It is raised in the same transaction as the consumed message. Kafka key and subject are the held unit id.

    allOf

    CloudEvents envelope for a StockHeld domain event (ADR 0052).

    • #held-stock
  • #18Stock Released

    A held quantity was released back to usable stock.

    Message IDStockReleased

    Raised by a RELEASE disposition (ADR 0052). The quantity re-enters usable stock through the staged-receipt path, so a StockReceived follows in the same transaction; it is usable once stowed. Kafka key and subject are the held unit id.

    allOf

    CloudEvents envelope for a StockReleased domain event (ADR 0052).

    • #held-stock
  • #19Stock Dispositioned

    A disposition was decided for a held unit.

    Message IDStockDispositioned

    Raised by every disposition decision (ADR 0052): RELEASE, RETURN_TO_VENDOR, SCRAP or REWORK. reason is the hold reason after the decision (a REWORK sets a new one). Kafka key and subject are the held unit id.

    allOf

    CloudEvents envelope for a StockDispositioned domain event (ADR 0052).

    • #held-stock
  • #20Receipt Carton Received (from inbound-receiving, consumed)

    A sealed carton was received on a receipt line; it becomes a Container once the line is booked.

    Message IDInboundReceivingReceiptCartonReceived

    CONSUMED, not produced (ADR 0045, 0046; contract section 2 with R6/R7 applied): type com.warehouse.wms.inbound-receiving.receipt.ReceiptCartonReceived, source=/warehouse/inbound-receiving. data is snake_case: {receipt_id, asn_number, sscc, parent_sscc, sealed, lpn, owner_ref, contents[{line_no, sku, gtin, qty, lot, expiry, condition}], received_at}. It carries NO site (R6): the container's site is derived at StowContainer from the bin. Unknown fields are ignored.

    Only a sealed, single-content, Good carton whose qty equals the case's units per pack in the PackagingView gets a Container (mixed, unsealed and damaged cartons keep their eaches as ordinary staged stock and get none). The carton is recorded keyed by (receipt_id, line_no, lpn) and settles idempotently in either arrival order relative to ReceiptLineReceived: the container exists only when the sum of container quantities of the line stays within the eaches ReceiptLineReceived booked, and when gtin is known to the PackagingView (otherwise it waits in the pending table). This message books NO quantity. The CloudEvents id is claimed in processed_events (consumer inbound-carton) in the same transaction.

    object

    CloudEvents 1.0 envelope of ReceiptCartonReceived as consumed here (not composed from CloudEventBase, whose source is this service's own).

    • #inbound-receiving
  • #21Product Pack Level Declared (from product-master, consumed)

    A pack level (EACH, INNER, CASE, PALLET) of a SKU with its GTIN and units per pack.

    Message IDProductMasterProductPackLevelDeclared

    CONSUMED, not produced (ADR 0046, contract R8): type com.warehouse.wms.product-master.product.ProductPackLevelDeclared, source=/warehouse/product-master, subject and Kafka key = SKU. Projected into the local PackagingView, keyed by GTIN and by (sku, level); an event applies only when its product version is not older than the stored one, and the CloudEvents id is claimed in processed_events (consumer product-master-pack-level). A newly known GTIN settles the cartons that were waiting for it. Unknown fields are ignored.

    object

    CloudEvents 1.0 envelope of ProductPackLevelDeclared as consumed here (not composed from CloudEventBase, whose source is this service's own).

    • #product-master
  • #22Product Pack Level Retired (from product-master, consumed)

    A pack level stops being in force from a date; its GTIN stays resolvable.

    Message IDProductMasterProductPackLevelRetired

    CONSUMED, not produced (ADR 0046, contract R8): type com.warehouse.wms.product-master.product.ProductPackLevelRetired. End-dates the level of gtin in the PackagingView (effective_to); the GTIN remains resolvable so cartons labelled with it still link. Applied when version is not older than the stored one; an unknown GTIN is a no-op.

    object

    CloudEvents 1.0 envelope of ProductPackLevelRetired as consumed here (not composed from CloudEventBase, whose source is this service's own).

    • #product-master
  • #23Task Completed (from fulfillment-execution, consumed)

    A station finished a claimed task; a PICK task makes this service confirm the picked line's reservation (or, without a line, the order's on its last pick).

    Message IDFulfillmentTaskCompleted

    CONSUMED, not produced (ADR 0035, ADR 0036). Pinned by fulfillment-execution's apis/asyncapi.yaml: type com.warehouse.wes.fulfillment-execution.task.TaskCompleted, source=/warehouse/fulfillment-execution, subject and Kafka key = task id. This service reads only task_id, task_type, order_ref, line_no and, on RELOCATE and REPLENISH tasks, sku, from_bin, to_bin, quantity and relocation_ref (RELOCATE) or request_ref (REPLENISH); every other field (station_id, work_unit_id, associate_id, duration_seconds) is ignored. order_ref is the additive optional field of ADR 0035 (v1, omitted when empty): the task's order reference, i.e. the OrderId order-management used as demand_ref. line_no is the additive optional field of ADR 0036 (v1, omitted when unknown): the order line the task was for. A message without order_ref, or with any task_type other than PICK, RELOCATE or REPLENISH, is a successful no-op; one without line_no takes the ADR 0035 counting path. The RELOCATE fields are the additive fields of ADR 0039 (decision E1, v1): fulfillment-execution sends them on RELOCATE tasks only, and a RELOCATE completion is applied as an intra-site move (StockRelocated). request_ref is the additive field of ADR 0041 (v1): REPLENISH tasks only, the replenishment request id, required on a REPLENISH completion; such a completion is applied as an intra-site move with reason REPLENISHMENT.

    object

    CloudEvents 1.0 envelope of fulfillment-execution's TaskCompleted v1 as consumed here (not composed from CloudEventBase, whose source is this service's own). Only the fields this service reads are listed under data; the producer sends more.

    • #fulfillment-execution
  • #24Receipt Line Received (from inbound-receiving, consumed)

    A quantity was received against an ASN line at the dock; Good units are booked as staged stock here.

    Message IDInboundReceivingReceiptLineReceived

    CONSUMED, not produced (ADR 0037). Pinned by inbound-receiving's apis/asyncapi.yaml (the handover event of its ADR 0003): type com.warehouse.wms.inbound-receiving.receipt.ReceiptLineReceived, source=/warehouse/inbound-receiving, subject = the receipt id, Kafka key = the ASN number. data is snake_case: {receipt_id, asn_number, line_no, sku, quantity, condition, received_at} with condition one of Good or Damaged. This service books sku and quantity of a Good line through ReceiveStock (its own clock stamps the resulting StockReceived; received_at, receipt_id, asn_number and line_no are logged, not stored) and does not book a Damaged line.

    object

    CloudEvents 1.0 envelope of inbound-receiving's ReceiptLineReceived v1 as consumed here (not composed from CloudEventBase, whose source is this service's own).

    • #inbound-receiving
  • #25Return Line Staged (from returns-processing, consumed)

    A RESTOCK disposition hands restockable units back as a staged receipt line.

    Message IDReturnsProcessingReturnLineStaged

    CONSUMED, not produced (ADR 0044). Pinned by returns-processing's apis/asyncapi.yaml: type com.warehouse.wms.returns-processing.disposition.ReturnLineStaged, source=/warehouse/returns-processing, subject and Kafka key = the disposition id. data is inbound-receiving's ReceiptLineReceived fields plus rma_id, disposition_id and site_id: {receipt_id, line_no, sku, quantity, condition, received_at, rma_id, disposition_id, site_id} with condition the constant Good (only a RESTOCK disposition stages a line). This service books sku and quantity through the SAME ReceiveStock use case as a receipt line (its own clock stamps the resulting StockReceived; the return context is logged, not stored), so the units are staged and not yet usable until stow.

    object

    CloudEvents 1.0 envelope of returns-processing's ReturnLineStaged v1 as consumed here (not composed from CloudEventBase, whose source is this service's own).

    • #returns-processing
  • #26Transfer Allocation Requested (from network-inventory-planning, consumed)

    network-inventory-planning asked this context to allocate origin stock for a transfer line.

    Message IDNetworkInventoryPlanningTransferAllocationRequested

    CONSUMED command, not produced (ADR 0030). Pinned by network-inventory-planning's apis/asyncapi.yaml: type com.warehouse.wes.network-inventory-planning.transfer.TransferAllocationRequested, source=/warehouse/network-inventory-planning, subject and Kafka key = the transfer line id. data is exactly five fields — the whole consumed contract; this service replies with TransferStockAllocated or TransferStockAllocationRejected on its own integration topic.

    object

    CloudEvents 1.0 envelope of network-inventory-planning's TransferAllocationRequested command as consumed here (not composed from CloudEventBase, whose source is this service's own).

    • #network-inventory-planning
  • #27Transfer Allocation Release Requested (from network-inventory-planning, consumed)

    network-inventory-planning cancelled a transfer AFTER allocation and asked this context to release the origin hold.

    Message IDNetworkInventoryPlanningTransferAllocationReleaseRequested

    CONSUMED command, not produced (ADR 0050 — the compensation leg that closes the saga's cancel-after-allocation gap). Pinned by network-inventory-planning's apis/asyncapi.yaml: type com.warehouse.wes.network-inventory-planning.transfer.TransferAllocationReleaseRequested, source=/warehouse/network-inventory-planning, subject and Kafka key = the transfer line id. data is exactly seven fields — the whole consumed contract; this service replies with TransferStockAllocationReleased on its own integration topic. Idempotent by transfer_line_id through the transfer_allocation_releases ledger: a byte-identical replay returns the original outcome untouched, a conflicting payload is answered with the original outcome and reason IDEMPOTENCY_CONFLICT. A command naming a line this service never decided, or disagreeing with the allocation ledger, is a deterministic refusal — logged and committed past, no event.

    object

    CloudEvents 1.0 envelope of network-inventory-planning's TransferAllocationReleaseRequested command as consumed here (ADR 0050; not composed from CloudEventBase, whose source is this service's own).

    • #network-inventory-planning
  • #28Stock Reserved

    A quantity was revocably bound to demand.

    Message IDStockReserved

    Raised by the ReserveStock use case when a reservation is successfully created against usable inventory (on-hand minus active reservations minus held/unlocated stock). The binding is revocable and carries a timeout, so a physical failure downstream never strands the demand.

    Published to both topics. On warehouse.inventory.events (dataschema urn:warehouse:inventory-storage:events:StockReserved:v1) the data payload is the adapter's reservationData shape — sku, quantity, demand_ref — and the reservation id is the CloudEvents subject and the Kafka key. wes-work-planning consumes this exact type to update its UsableInventoryObserved read model by SKU. On warehouse.inventory.analytics (dataschema ...:analytics:StockReserved:v1, Kafka key = reservation id — ADR 0021) data is {sku, reservation_id, quantity}.

    allOf

    CloudEvents envelope for a StockReserved domain event, on both topics; dataschema selects the data shape.

    • #reservation
  • #29Transfer Stock Allocated

    Origin-site stock was reserved for a network transfer line.

    Message IDTransferStockAllocated

    Raised by the AllocateTransferStock use case when a transfer allocation command from network-inventory-planning (com.warehouse.wes.network-inventory-planning.transfer.TransferAllocationRequested on warehouse.network-inventory-planning.events) was satisfied: usable stock in the ORIGIN SITE's custody was drawn and a revocable Reservation now holds it, correlated to the transfer line via the transfer_allocations ledger (one row per transfer_line_id, DB-unique — replays return this same event's original outcome without re-deciding).

    Integration topic only (no analytics variant: the Inventory Flow & Accuracy projection has no transfer dimension). Kafka key and CloudEvents subject are the reservation id, so a transfer's replies stay per-reservation ordered (ADR 0021).

    allOf

    CloudEvents envelope for a TransferStockAllocated domain event.

    • #reservation
  • #30Transfer Stock Allocation Rejected

    No stock was held for a network transfer line; the closed reason says why.

    Message IDTransferStockAllocationRejected

    Raised by the AllocateTransferStock use case when a transfer allocation command could not be satisfied. reason is a CLOSED set: ORIGIN_SITE_UNKNOWN (no usable stock in the requested origin site's custody — including legacy site-less stock, which is never transfer-allocatable), INSUFFICIENT_USABLE (the origin holds the SKU but not enough usable quantity), IDEMPOTENCY_CONFLICT (the transfer_line_id was replayed with a DIFFERENT command payload; the original ledger decision stands and this reply tells the planner so).

    Integration topic only (no analytics variant). Kafka key and CloudEvents subject are the transfer_line_id — a rejection has no reservation, so the line is the aggregate the reply is about.

    allOf

    CloudEvents envelope for a TransferStockAllocationRejected domain event.

    • #reservation
  • #31Transfer Stock Allocation Released

    A transfer cancelled after allocation had its origin hold resolved; the saga settles.

    Message IDTransferStockAllocationReleased

    Raised by the ReleaseTransferAllocation use case (ADR 0051) when a TransferAllocationReleaseRequested command was decided — the compensation leg of the transfer saga, so a stuck or abandoned ALLOCATED transfer never strands its origin reservation until lazy expiry. outcome is a CLOSED set: RELEASED (the reservation still held the stock; this revoked it and returned the quantity to usable), ALREADY_RESOLVED (the reservation had already expired or been confirmed — or the line's allocation was REJECTED, so no hold ever existed; either way the hold is gone). BOTH outcomes settle the saga as success. reason is the command's cancellation reason carried through, or IDEMPOTENCY_CONFLICT on the answer to a conflicting replay (the original ledger decision stands).

    Integration topic only (no analytics variant). Kafka key and CloudEvents subject are the transfer_line_id, mirroring TransferStockAllocationRejected — the release settles the line, so the line is the aggregate the fact is about.

    allOf

    CloudEvents envelope for a TransferStockAllocationReleased domain event (ADR 0051).

    • #reservation
  • #32Transfer Receipt Staged

    A destination site counted goods against a recognized ALLOCATED transfer line.

    Message IDTransferReceiptStaged

    Raised by the StageTransferReceipt use case (ADR 0033, destination receipt custody — POST /transfers/{transferLineId}/receipt). The transfer_line_id was found in the transfer_allocations ledger with outcome ALLOCATED: a transfer_receipts row (state STAGED, DB-unique on transfer_line_id) now records expected_quantity from the ledger, received_quantity as counted, and the SIGNED variance (received - expected; positive = over, negative = short). Over/short is explicit on the wire, never silently absorbed.

    NO usable stock moves at this step — the destination site's usable rises only when the stow completes (TransferStockStowed). An unrecognized scan is NOT this event: it is quarantined as an inventory_exceptions row and publishes nothing that raises availability.

    Integration topic only (no analytics variant: the Inventory Flow & Accuracy projection has no transfer dimension). Kafka key and CloudEvents subject are the transfer_line_id, so a line's stage-then-stow facts stay ordered on one partition (ADR 0021).

    allOf

    CloudEvents envelope for a TransferReceiptStaged domain event (ADR 0033).

    • #stock
  • #33Transfer Stock Stowed

    A staged transfer receipt was placed into destination bins — destination usable rose, exactly once.

    Message IDTransferStockStowed

    Raised by the StowTransferStock use case (ADR 0033 — POST /transfers/{transferLineId}/stowages): the ONLY path that raises the destination site's usable stock for a transfer. One StockUnit per bin leg was created AT the destination site (NewStockUnitAtSite), every bin verified to belong to that site's custody, the quantities summed exactly to the receipt's received_quantity, and the receipt moved STAGED -> STOWED.

    Idempotent at the database level: a replayed stow for a STOWED receipt returns the original outcome and republishes NOTHING — exactly one of these events exists per transfer_line_id.

    Integration topic only (no analytics variant). Kafka key and CloudEvents subject are the transfer_line_id, matching TransferReceiptStaged so a line's facts stay per-line ordered (ADR 0021).

    allOf

    CloudEvents envelope for a TransferStockStowed domain event (ADR 0033).

    • #stock
  • #34Stock Relocated

    A quantity of one SKU moved from one bin to another bin of the same site — on hand unchanged, location changed, exactly once.

    Message IDStockRelocated

    Raised by the RelocateStock use case (ADR 0039), reached two ways: POST /relocations (Idempotency-Key) and the RELOCATE branch of the TaskCompleted consumer (a completed slot-plan RELOCATE task from fulfillment-execution). In ONE transaction the source bin's occupancy fell and the destination bin's rose by quantity, the touched source StockUnits were decremented, ONE new StockUnit was created at to_bin, the immutable relocations row was written and this outbox row enqueued. Site-level on-hand is unchanged.

    Exactly once per relocation: a replayed POST returns the stored response and a redelivered TaskCompleted (same CloudEvents id) is a no-op, so neither publishes again. source_ref is always present ("" when none); on the task path it is the task's relocation_ref, or its task id when the producer sent none. A completed REPLENISH task (ADR 0041) reaches the same use case with reason REPLENISHMENT and source_ref = the task's request_ref (the replenishment request id; required, no task-id fallback), which pick-face-replenishment matches to complete its request.

    Integration topic only (no analytics variant). Kafka key and CloudEvents subject are the relocation id (ADR 0021). slotting-optimization consumes it to close a slot plan's move; it must act only on reason = SLOTTING.

    allOf

    CloudEvents envelope for a StockRelocated domain event (ADR 0039).

    • #stock
  • #35Bin Stock Level Changed

    The absolute stock level of one SKU in one bin after a ledger change — on hand, reserved, and a per-(bin, sku) version.

    Message IDBinStockLevelChanged

    Raised from the SAME transaction as every ledger change that moves the level of a SKU in a bin (ADR 0040), through the transactional outbox: stow and transfer stow (STOW), a confirmed pick (PICK), a relocation or RELOCATE task (RELOCATE: two events, the source bin then the destination bin), a cycle-count shortfall (COUNT), a reservation or transfer allocation (RESERVE), and a revoked or expired reservation (REVOKE). One event per distinct (bin, sku) per transaction, carrying the FINAL level after the whole transaction: an order whose lines pick the same (bin, sku) raises it once. Nothing is raised when the level did not change (idempotent replays, rejected commands).

    on_hand and reserved are ABSOLUTE levels after the change, never deltas. on_hand is the quantity physically in the bin as the ledger sees it (located, still-present units: units a cycle count marked unlocated, and fully picked-out units, are not counted); reserved is the part of it bound to active reservations, so on_hand - reserved is what a new reservation could still draw from the bin. version is the persisted per-(bin, sku) counter, strictly increasing and gapless across restarts and concurrent changes: a consumer keeps the highest version it has seen for a (bin, sku) and ignores any lower one.

    reason is STOW, PICK, RELOCATE, REPLENISHMENT, COUNT, RESERVE, REVOKE or UNLOCATED; consumers ignore values they do not know. REPLENISHMENT is the reason of a relocation made by a completed REPLENISH task (ADR 0041: two events, the source bin then the destination bin, like RELOCATE), and UNLOCATED is reserved for an unlocated receive with a bin: it is not emitted today (a receive names no bin). A bin whose site cannot be determined (not registered, or neither a recorded site custody nor a facility-layout location code) raises no event. Stock owned by a seller (ADR 0045) has its own level per owner: the optional owner_ref names it and the version counter is per (bin, sku, owner); a consumer that ignores owner_ref sees interleaved levels, so it should key on (bin, sku, owner_ref).

    Integration topic only (no analytics variant). Kafka key and CloudEvents subject are <bin>:<sku>, so every level of one pair lands on one partition in version order (ADR 0021). pick-face-replenishment consumes it to detect a forward pick slot below its minimum.

    allOf

    CloudEvents envelope for a BinStockLevelChanged domain event (ADR 0040).

    • #stock
  • #36Reservation Expired

    A reservation's timeout elapsed before pick confirmation.

    Message IDReservationExpired

    Describes a reservation that timed out without being confirmed or revoked, so its quantity returns to usable. Raised lazily: the Reservation aggregate's IsExpired/Expire() are invoked the next time the reservation is read (GetReservationsByDemandRef, RevokeReservation, ConfirmPick, or ReserveStock's own idempotency lookup), not by a background sweeper — see ADR 0003's "Lazy expiry" section for the full rationale.

    Published to warehouse.inventory.analytics only (subject = Kafka key = reservation id), with the reservation's SKU enriched in: analytics data is {reservation_id, sku}. It does not cross to the integration topic.

    allOf

    CloudEvents envelope for a ReservationExpired domain event.

    • #reservation
  • #37Reservation Revoked

    A reservation was cancelled and its quantity returned to usable.

    Message IDReservationRevoked

    Raised by the RevokeReservation use case. Revocation is the mechanism that keeps a physical failure — a blocked pod, a lost tote, a chute jam, a short pick — from stranding an order: the quantity goes back to usable and the demand can be re-allocated against a different holding.

    Published to both topics. On warehouse.inventory.events (dataschema urn:warehouse:inventory-storage:events:ReservationRevoked:v1) the domain event carries only the reservation id, so the adapter enriches it through ports.ReservationRepo and emits the same sku / quantity / demand_ref shape as StockReserved; if the lookup finds nothing the publish fails rather than emitting a partial payload. The reservation id is the subject and the Kafka key. wes-work-planning consumes this exact type. On warehouse.inventory.analytics data is {reservation_id, sku}.

    allOf

    CloudEvents envelope for a ReservationRevoked domain event. The data member is enriched by the outbound Kafka adapter, which looks the reservation up through ports.ReservationRepo because the domain event carries only the reservation id.

    • #reservation
  • #38Stock Picked

    Reserved quantity was physically removed from its bin.

    Message IDStockPicked

    Raised by the ConfirmPick use case. It consumes the reservation — a reservation cannot be double-consumed — and permanently removes the quantity from on-hand. Grouped under the reservation entity segment because the reservation id is the only identity the event carries.

    Published to warehouse.inventory.analytics only (subject = reservation id, Kafka key = reservation id — ADR 0021). Analytics data: {sku, reservation_id, quantity}.

    allOf

    CloudEvents envelope for a StockPicked domain event.

    • #reservation
  • #39Item Unlocated

    A physical item's bin is no longer known — the stock is lost.

    Message IDItemUnlocated

    Raised by the RunCycleCount use case when a count comes up short: the quantity the system believed was in the bin is not there, so the affected StockUnit quantity is flagged Unlocated and removed from usable. This is the explicit escape hatch for the "every item has exactly one known bin" rule.

    Published to both topics (promoted to the integration topic 2026-10-21, ADR 0043, for exception-management). Subject = stock unit id, Kafka key = SKU on both topics (the split the analytics publisher always used: every fact about one SKU's units stays on one partition while the subject names the lost unit); data is byte-identical: {sku, bin_id, stock_unit_id, quantity}. Only the dataschema stream differs.

    allOf

    CloudEvents envelope for an ItemUnlocated domain event.

    • #stock
  • #40Cycle Count Completed

    A bin's contents were verified against system records.

    Message IDCycleCountCompleted

    Raised by the RunCycleCount use case once a bin has been counted and reconciled. The discrepancy flag says whether the counted quantity matched the system quantity; when it did not, a DiscrepancyDetected event and possibly ItemUnlocated events are emitted alongside this one.

    Published to warehouse.inventory.analytics only (subject = bin id, Kafka key = bin id). Analytics data: {bin_id, counted, system, discrepancy}.

    allOf

    CloudEvents envelope for a CycleCountCompleted domain event.

    • #bin
  • #41Discrepancy Detected

    A cycle count found system records did not match physical reality.

    Message IDDiscrepancyDetected

    Raised by the RunCycleCount use case when the counted quantity differs from the system quantity for a bin, before reconciliation is applied. A shortfall additionally produces ItemUnlocated events for the quantity that could not be found.

    Published to both topics (promoted to the integration topic 2026-10-21, ADR 0043, for exception-management). Subject = Kafka key = bin id on both topics; data is byte-identical: {bin_id, counted, system}. Only the dataschema stream differs.

    allOf

    CloudEvents envelope for a DiscrepancyDetected domain event.

    • #bin

Schemas

  • object

    The CloudEvents 1.0 context attributes shared by every message this bounded context emits, in structured-mode JSON. Each concrete event schema composes this with allOf and pins type to a single value.

  • allOf

    CloudEvents envelope for a StockReceived domain event.

  • allOf

    CloudEvents envelope for an ItemStowed domain event.

  • allOf

    CloudEvents envelope for a LocationRecorded domain event.

  • object

    CloudEvents 1.0 envelope of facility-layout's ZoneRegistered as consumed here (not composed from CloudEventBase, whose source is this service's own).

  • object

    CloudEvents 1.0 envelope of slotting-optimization's SlotPlanApproved as consumed here (not composed from CloudEventBase, whose source is this service's own).

  • object

    CloudEvents 1.0 envelope of facility-layout's LocationSlotRegistered as consumed here (not composed from CloudEventBase, whose source is this service's own).

  • object

    CloudEvents 1.0 envelope of facility-layout's LocationSlotDecommissioned as consumed here (not composed from CloudEventBase, whose source is this service's own).

  • object

    CloudEvents 1.0 envelope of facility-layout's LocationSlotHandlingUnitDeclared as consumed here (not composed from CloudEventBase, whose source is this service's own).

  • object

    CloudEvents 1.0 envelope of product-master's ProductClassified as consumed here (not composed from CloudEventBase, whose source is this service's own).

  • object

    CloudEvents 1.0 envelope of fulfillment-execution's TaskCompleted v1 as consumed here (not composed from CloudEventBase, whose source is this service's own). Only the fields this service reads are listed under data; the producer sends more.

  • object

    CloudEvents 1.0 envelope of inbound-receiving's ReceiptLineReceived v1 as consumed here (not composed from CloudEventBase, whose source is this service's own).

  • allOf

    CloudEvents envelope for a ContainerRegistered domain event (ADR 0045).

  • allOf

    CloudEvents envelope for a ContainerStowed domain event (ADR 0045).

  • allOf

    CloudEvents envelope for a CaseBroken domain event (ADR 0045).

  • allOf

    CloudEvents envelope for a ContainerEmptied domain event (ADR 0045).

  • allOf

    CloudEvents envelope for a ToteRegistered domain event (ADR 0054).

  • allOf

    CloudEvents envelope for a ToteFilled domain event (ADR 0054).

  • allOf

    CloudEvents envelope for a ToteStowed domain event (ADR 0054).

  • allOf

    CloudEvents envelope for a StockHeld domain event (ADR 0052).

  • allOf

    CloudEvents envelope for a StockReleased domain event (ADR 0052).

  • allOf

    CloudEvents envelope for a StockDispositioned domain event (ADR 0052).

  • object

    CloudEvents 1.0 envelope of ReceiptCartonReceived as consumed here (not composed from CloudEventBase, whose source is this service's own).

  • object

    CloudEvents 1.0 envelope of ProductPackLevelDeclared as consumed here (not composed from CloudEventBase, whose source is this service's own).

  • object

    CloudEvents 1.0 envelope of ProductPackLevelRetired as consumed here (not composed from CloudEventBase, whose source is this service's own).

  • object

    CloudEvents 1.0 envelope of returns-processing's ReturnLineStaged v1 as consumed here (not composed from CloudEventBase, whose source is this service's own).

  • object

    CloudEvents 1.0 envelope of network-inventory-planning's TransferAllocationRequested command as consumed here (not composed from CloudEventBase, whose source is this service's own).

  • object

    CloudEvents 1.0 envelope of network-inventory-planning's TransferAllocationReleaseRequested command as consumed here (ADR 0050; not composed from CloudEventBase, whose source is this service's own).

  • allOf

    CloudEvents envelope for a StockReserved domain event, on both topics; dataschema selects the data shape.

  • allOf

    CloudEvents envelope for a ReservationExpired domain event.

  • allOf

    CloudEvents envelope for a ReservationRevoked domain event. The data member is enriched by the outbound Kafka adapter, which looks the reservation up through ports.ReservationRepo because the domain event carries only the reservation id.

  • allOf

    CloudEvents envelope for a StockPicked domain event.

  • allOf

    CloudEvents envelope for an ItemUnlocated domain event.

  • allOf

    CloudEvents envelope for a CycleCountCompleted domain event.

  • allOf

    CloudEvents envelope for a DiscrepancyDetected domain event.

  • allOf

    CloudEvents envelope for a TransferStockAllocated domain event.

  • allOf

    CloudEvents envelope for a TransferStockAllocationRejected domain event.

  • allOf

    CloudEvents envelope for a TransferStockAllocationReleased domain event (ADR 0051).

  • allOf

    CloudEvents envelope for a TransferReceiptStaged domain event (ADR 0033).

  • allOf

    CloudEvents envelope for a TransferStockStowed domain event (ADR 0033).

  • allOf

    CloudEvents envelope for a StockRelocated domain event (ADR 0039).

  • allOf

    CloudEvents envelope for a BinStockLevelChanged domain event (ADR 0040).