pick-face-replenishment Domain Events 1.0.0

Event catalog for the pick-face-replenishment bounded context (WMS subdomain): min/max replenishment of forward pick faces from reserve bins (ADR 0001, ADR 0002).

Published. The ReplenishmentRequest aggregate raises three events, published to warehouse.pick-face-replenishment.events through a transactional outbox: the request row and its already-encoded events are written in ONE database transaction and a relay drains them to Kafka (at-least-once; the CloudEvents id is stored with the outbox row, so a retry republishes the same id). ReplenishmentRequested is what wes-work-planning turns into REPLENISH work; ReplenishmentCompleted and ReplenishmentCancelled close the request. The same three types are mirrored on warehouse.pick-face-replenishment.analytics (dataschema urn:warehouse:pick-face-replenishment:analytics:<EventName>:v1), together with ReplenishmentPolicyDeclared, which is analytics-only.

Consumed (ADR 0003). BinStockLevelChanged (producer change P1, built in inventory-storage) and StockRelocated from inventory-storage, SlotPlanApproved from slotting-optimization, and ZoneRegistered, LocationSlotRegistered and LocationSlotDecommissioned from facility-layout. Each feeds a durable local copy or closes a request (modes INVENTORY_MODE, SLOTTING_MODE, LAYOUT_MODE, PACK_LEVEL_MODE: default and only accepted value kafka, permissive is rejected at boot; consumer groups are required, from INVENTORY_CONSUMER_GROUP, SLOTTING_CONSUMER_GROUP, LAYOUT_CONSUMER_GROUP, PACK_LEVEL_CONSUMER_GROUP). A message that fails deterministically, or after the bounded retries, is published to <topic>.dlq with x-dlq-* headers. ProductPackLevelDeclared and ProductPackLevelRetired from product-master are consumed as well. The consumed messages below are the producers' own contracts, decoded independently here and never imported.

Envelope (mandatory). CloudEvents 1.0, structured content mode, Kafka header content-type: application/cloudevents+json; charset=UTF-8. Optional W3C trace-context headers (traceparent, and tracestate / baggage when present) carry the trace of the request that wrote the outbox row; consumers may extract them, and must not require them. specversion, id, source (/warehouse/pick-face-replenishment), type, subject (the request id; <site_id>/<sku> for the policy event), time, datacontenttype (application/json) and dataschema (urn:warehouse:pick-face-replenishment:<events|analytics>:<EventName>:v1) are all required. Kafka key = the subject. Type = com.warehouse.wms.pick-face-replenishment.<entity>.<EventName>. A breaking payload change is a new .v2 type, never a mutation.

  • #pick-face-replenishment
  • #replenishment
  • #policy
  • #analytics
  • #consumed

Servers

  • {brokers}kafkaproduction

    Fleet-shared Kafka broker (host supplied by the deployment environment).

    object
    string
    required
    Security:
    security.protocol:PLAINTEXT

Operations

  • SUB warehouse.pick-face-replenishment.events

    This service's integration topic. Written by the outbox relay; key = request id; every message carries the CloudEvents content-type header (plus the optional W3C traceparent of the writing request). Dispatch on the full type, ignore unknown types, dedupe on id.

    Receive ReplenishmentRequest events.

    Subscribe to replenishment requests and their outcome. Route on the full type (com.warehouse.wms.pick-face-replenishment.replenishment.<EventName>). ReplenishmentRequested is the only one that asks the floor to do something; the other two are the request's final states.

    Operation IDreceiveReplenishmentEvents

    Available only on servers:

    • #replenishment

    Accepts one of the following messages:

    • #0Replenishment requested

      A forward pick face needs stock; move `quantity` units of the SKU from `source_bin` to `forward_bin`.

      type = com.warehouse.wms.pick-face-replenishment.replenishment.ReplenishmentRequested; subject and key = the request id. priority is URGENT when the pick face had nothing available (on_hand - reserved <= 0) at detection, else NORMAL. policy_min and policy_max are the policy values the request was sized with.

      allOf
      • #replenishment

      Examples

    • #1Replenishment completed

      The relocation of a request was recorded on the stock ledger.

      type = com.warehouse.wms.pick-face-replenishment.replenishment.ReplenishmentCompleted; subject and key = the request id. quantity is what inventory-storage's StockRelocated moved, which can be less than the requested quantity.

      allOf
      • #replenishment

      Examples

    • #2Replenishment cancelled

      An open request was cancelled before its relocation was recorded.

      type = com.warehouse.wms.pick-face-replenishment.replenishment.ReplenishmentCancelled; subject and key = the request id. reason is OPERATOR, ASSIGNMENT_CHANGED (a newer approved slot plan no longer assigns the SKU to the forward bin) or POLICY_REMOVED. Consumers cancel work they have not yet released.

      allOf
      • #replenishment

      Examples

  • SUB warehouse.pick-face-replenishment.analytics

    This service's own analytics stream (ADR 0008), written by the SAME transactional outbox as the integration topic: every request event appears here too, under the SAME CloudEvents id and type, with only the dataschema stream segment different (urn:warehouse:pick-face-replenishment:analytics::v1), plus the analytics-only ReplenishmentPolicyDeclared (key and subject <site_id>/<sku>). It is NOT an integration contract: the only consumer is this service's cmd/pfr-projector (fixed group from ANALYTICS_CONSUMER_GROUP), which folds the events into the analytical database; its deterministic poison goes to warehouse.pick-face-replenishment.analytics.dlq. Other contexts keep reading warehouse.pick-face-replenishment.events.

    Receive the analytics twin of every request event and the policy declaration.

    Request payloads are byte-for-byte the integration payloads (ADR 0008 section 2); only the dataschema names the analytics stream. ReplenishmentPolicyDeclared is raised each time a policy is declared or changed, with the new version. Removing a policy raises no event of its own; its open requests are cancelled with reason POLICY_REMOVED.

    Operation IDreceiveReplenishmentAnalytics

    Available only on servers:

    • #analytics

    Accepts one of the following messages:

    • #0Replenishment requested (analytics twin)

      The analytics-stream twin of ReplenishmentRequested (ADR 0008).

      Same type, id, subject, key and payload as the integration message; dataschema = urn:warehouse:pick-face-replenishment:analytics:ReplenishmentRequested:v1. Consumed only by cmd/pfr-projector.

      allOf
      • #analytics

      Examples

    • #1Replenishment completed (analytics twin)

      The analytics-stream twin of ReplenishmentCompleted (ADR 0008).

      Same type, id, subject, key and payload as the integration message; dataschema = urn:warehouse:pick-face-replenishment:analytics:ReplenishmentCompleted:v1. Consumed only by cmd/pfr-projector.

      allOf
      • #analytics

      Examples

    • #2Replenishment cancelled (analytics twin)

      The analytics-stream twin of ReplenishmentCancelled (ADR 0008).

      Same type, id, subject, key and payload as the integration message; dataschema = urn:warehouse:pick-face-replenishment:analytics:ReplenishmentCancelled:v1. Consumed only by cmd/pfr-projector.

      allOf
      • #analytics

      Examples

    • #3Replenishment policy declared

      A min/max policy was declared or changed (analytics only).

      type = com.warehouse.wms.pick-face-replenishment.policy.ReplenishmentPolicyDeclared; subject and key = <site_id>/<sku>. Analytics topic only.

      allOf
      • #policy

      Examples

  • PUB warehouse.product-master.events

    product-master's integration topic. Consumed for ProductPackLevelDeclared and ProductPackLevelRetired (packaging view: the eaches factor per pack level that min/max and request quantities are converted with), consumer group from env PACK_LEVEL_CONSUMER_GROUP (when PACK_LEVEL_MODE=kafka).

    Apply product-master pack-level facts to the local packaging copy.

    Upserts the packaging view in one transaction with the CloudEvents id claim; unknown types on the topic are skipped.

    Operation IDapplyProductMasterPackLevel

    Available only on servers:

    Accepts one of the following messages:

    • #0product-master ProductPackLevelDeclared (consumed)

      A pack level (EACH, INNER, CASE or PALLET) of a SKU was declared, or one of its mutable attributes changed.

      type = com.warehouse.wms.product-master.product.ProductPackLevelDeclared, source /warehouse/product-master, dataschema urn:warehouse:product-master:events:ProductPackLevelDeclared:v1; subject and key = the SKU. Produced by product-master; consumed into the local packaging view (pack level -> eaches factor for case-level scans). The keys are snake_case, exactly as product-master's encoder writes them (units_per_pack, effective_from, effective_to).

      allOf
      • #consumed

      Examples

    • #1product-master ProductPackLevelRetired (consumed)

      A pack level of a SKU was retired.

      type = com.warehouse.wms.product-master.product.ProductPackLevelRetired, source /warehouse/product-master, dataschema urn:warehouse:product-master:events:ProductPackLevelRetired:v1; subject and key = the SKU. Produced by product-master; consumed into the local packaging view (retired levels are no longer valid scan targets).

      allOf
      • #consumed

      Examples

  • PUB warehouse.inventory.events

    inventory-storage's integration topic. This service consumes BinStockLevelChanged (key <bin>:<sku>, so one bin-and-SKU stream is totally ordered) and StockRelocated (key relocation_id) under a stable consumer group read from env INVENTORY_CONSUMER_GROUP when INVENTORY_MODE=kafka. Every other type on the topic is ignored.

    Consume bin stock levels and relocations.

    BinStockLevelChanged feeds the bin_stock_levels copy: the levels are ABSOLUTE and a message is applied only when its version is greater than the stored one for the bin and SKU. StockRelocated completes a request only when reason is REPLENISHMENT, source_ref is a request id of this service and the SKU and bins match; every other relocation is ignored. The CloudEvents id claim and the effect commit in one transaction; the offset is committed afterwards (ADR 0003).

    Operation IDconsumeInventoryStorageEvents

    Available only on servers:

    • #consumed

    Accepts one of the following messages:

    • #0BinStockLevelChanged (consumed, inventory-storage)

      The absolute on-hand and reserved level of one SKU in one bin changed.

      Producer change P1 is built: inventory-storage publishes this type (its ADR 0040). The contract was pinned here consumer-first. type = com.warehouse.wms.inventory-storage.stock.BinStockLevelChanged, source /warehouse/inventory-storage, dataschema urn:warehouse:inventory-storage:events:BinStockLevelChanged:v1. Subject and Kafka key = <bin>:<sku>. on_hand and reserved are ABSOLUTE levels after the change, not deltas; reserved is the units of this bin bound by active reservations. Keep the highest version per bin and SKU and ignore lower ones. The consumer reads only site_code, bin, sku, on_hand, reserved and version; reason is not read.

      allOf
      • #consumed

      Examples

    • #1StockRelocated (consumed, inventory-storage)

      A quantity of one SKU moved from one bin to another bin of the same site.

      type = com.warehouse.wms.inventory-storage.stock.StockRelocated, dataschema urn:warehouse:inventory-storage:events:StockRelocated:v1. Subject and Kafka key = relocation_id. Restated from inventory-storage's contract (its ADR 0039), never imported. Act only when reason is REPLENISHMENT, a value inventory-storage added with producer change P4 (its ADR 0041; it also publishes SLOTTING, CONSOLIDATION and MANUAL); ignore every other reason.

      allOf
      • #consumed

      Examples

  • PUB warehouse.slotting-optimization.events

    slotting-optimization's integration topic. This service consumes ONLY SlotPlanApproved (key and subject = the plan id) under a stable consumer group read from env SLOTTING_CONSUMER_GROUP when SLOTTING_MODE=kafka. Every other type is ignored.

    Consume the approved forward-slot map.

    assignments is the FULL forward map of the site: replace the site's forward_assignments copy wholesale from it. A request whose forward bin no longer holds its SKU in the new map is cancelled with reason ASSIGNMENT_CHANGED. The CloudEvents id claim and the effect commit in one transaction.

    Operation IDconsumeSlottingOptimizationEvents

    Available only on servers:

    • #consumed

    Accepts the following message:

    SlotPlanApproved (consumed, slotting-optimization)

    A slot plan was approved; it is now the site's forward-slot map.

    type = com.warehouse.wms.slotting-optimization.slotplan.SlotPlanApproved, source /warehouse/slotting-optimization, dataschema urn:warehouse:slotting-optimization:events:SlotPlanApproved:v1. Subject and Kafka key = the plan id. assignments is the FULL map of the plan.

    allOf
    • #consumed

    Examples

  • PUB warehouse.facility.events

    facility-layout's integration topic. This service consumes ZoneRegistered (key zoneId), LocationSlotRegistered and LocationSlotDecommissioned (key locationCode) under a stable consumer group read from env LAYOUT_CONSUMER_GROUP when LAYOUT_MODE=kafka. Every other type is ignored.

    Consume zones and location slots.

    A location is joined to its zone through zoneId at detection time. A reserve bin is a Storage location (absent role = Storage) in a zone listed in RESERVE_ZONE_CODES (default RSV). Decommissioning removes the location and is irreversible.

    Operation IDconsumeFacilityLayoutEvents

    Available only on servers:

    • #consumed

    Accepts one of the following messages:

    • #0ZoneRegistered (consumed, facility-layout)

      A behavioural zone was added inside a site's area.

      type = com.warehouse.wms.facility-layout.zone.ZoneRegistered, source /warehouse/facility-layout, dataschema urn:warehouse:facility-layout:events:ZoneRegistered:v1. Subject and Kafka key = zoneId. data also carries eventName, eventType and occurredAt, which are ignored.

      allOf
      • #consumed

      Examples

    • #1LocationSlotRegistered (consumed, facility-layout)

      A coded leaf slot now exists on the warehouse map.

      type = com.warehouse.wms.facility-layout.locationslot.LocationSlotRegistered, dataschema urn:warehouse:facility-layout:events:LocationSlotRegistered:v1. Subject and Kafka key = locationCode. An absent role means Storage. data also carries eventName, eventType and occurredAt, which are ignored.

      allOf
      • #consumed

      Examples

    • #2LocationSlotDecommissioned (consumed, facility-layout)

      A coded slot was permanently retired.

      type = com.warehouse.wms.facility-layout.locationslot.LocationSlotDecommissioned, dataschema urn:warehouse:facility-layout:events:LocationSlotDecommissioned:v1. Subject and Kafka key = locationCode. Irreversible: the location is removed from the local copy.

      allOf
      • #consumed

      Examples

  • PUB warehouse.order-management.events

    order-management's integration topic. This service consumes ONLY SiteSkuDemandChanged (ADR 0015; the PII-free demand projection of its ADR 0035, amended by its ADR 0044), keyed <source_order_id>/line/<line_no> so one line's demand stream is totally ordered on its own partition, under a stable consumer group read from env DEMAND_CONSUMER_GROUP when DEMAND_MODE=kafka. Every other type on the topic (OrderAllocated, OrderPartiallyAllocated, OrderRepromised, anything future) is ignored.

    Consume the site/SKU demand projection.

    Each fact feeds the site_sku_demand_lines copy and appends its signed delta (+demanded_units for ACTIVE, -demanded_units for REMOVED) to site_sku_demand_history: the rolling demand rate a DEMAND_COVER policy is sized from is the net history sum over its trailing demandWindowDays, clamped at 0 (ADR 0015). The CloudEvents id claim and the effect commit in one transaction; the offset is committed afterwards, so a line's facts apply in emission order.

    Operation IDconsumeOrderManagementDemandEvents

    Available only on servers:

    • #consumed

    Accepts the following message:

    SiteSkuDemandChanged (consumed, order-management)

    One source order line's site/SKU demand became ACTIVE or REMOVED.

    order-management's PII-free demand projection (its ADR 0035, amended by its ADR 0044), restated here independently — never imported from its code. type = com.warehouse.wes.order-management.siteskudemand.SiteSkuDemandChanged, source /warehouse/order-management, dataschema urn:warehouse:order-management:events:SiteSkuDemandChanged:v1. Subject and Kafka key = <source_order_id>/line/<line_no> — the LINE is the stream identity, so one line's demand history is totally ordered on its own partition. state is ACTIVE (the line's demand exists at the site) or REMOVED (a cancellation took it away; demanded_units repeats the quantity it removes). due_at is the line's promise-group cutoff, else the order-level promise date. The consumer reads every field; no customer PII ever appears on this event.

    allOf
    • #consumed

    Examples

Messages

  • #1Replenishment requested

    A forward pick face needs stock; move `quantity` units of the SKU from `source_bin` to `forward_bin`.

    Message IDReplenishmentRequested

    type = com.warehouse.wms.pick-face-replenishment.replenishment.ReplenishmentRequested; subject and key = the request id. priority is URGENT when the pick face had nothing available (on_hand - reserved <= 0) at detection, else NORMAL. policy_min and policy_max are the policy values the request was sized with.

    allOf
    • #replenishment
  • #2Replenishment completed

    The relocation of a request was recorded on the stock ledger.

    Message IDReplenishmentCompleted

    type = com.warehouse.wms.pick-face-replenishment.replenishment.ReplenishmentCompleted; subject and key = the request id. quantity is what inventory-storage's StockRelocated moved, which can be less than the requested quantity.

    allOf
    • #replenishment
  • #3Replenishment cancelled

    An open request was cancelled before its relocation was recorded.

    Message IDReplenishmentCancelled

    type = com.warehouse.wms.pick-face-replenishment.replenishment.ReplenishmentCancelled; subject and key = the request id. reason is OPERATOR, ASSIGNMENT_CHANGED (a newer approved slot plan no longer assigns the SKU to the forward bin) or POLICY_REMOVED. Consumers cancel work they have not yet released.

    allOf
    • #replenishment
  • #4Replenishment policy declared

    A min/max policy was declared or changed (analytics only).

    Message IDReplenishmentPolicyDeclared

    type = com.warehouse.wms.pick-face-replenishment.policy.ReplenishmentPolicyDeclared; subject and key = <site_id>/<sku>. Analytics topic only.

    allOf
    • #policy
  • #5Replenishment requested (analytics twin)

    The analytics-stream twin of ReplenishmentRequested (ADR 0008).

    Message IDReplenishmentRequestedAnalytics

    Same type, id, subject, key and payload as the integration message; dataschema = urn:warehouse:pick-face-replenishment:analytics:ReplenishmentRequested:v1. Consumed only by cmd/pfr-projector.

    allOf
    • #analytics
  • #6Replenishment completed (analytics twin)

    The analytics-stream twin of ReplenishmentCompleted (ADR 0008).

    Message IDReplenishmentCompletedAnalytics

    Same type, id, subject, key and payload as the integration message; dataschema = urn:warehouse:pick-face-replenishment:analytics:ReplenishmentCompleted:v1. Consumed only by cmd/pfr-projector.

    allOf
    • #analytics
  • #7Replenishment cancelled (analytics twin)

    The analytics-stream twin of ReplenishmentCancelled (ADR 0008).

    Message IDReplenishmentCancelledAnalytics

    Same type, id, subject, key and payload as the integration message; dataschema = urn:warehouse:pick-face-replenishment:analytics:ReplenishmentCancelled:v1. Consumed only by cmd/pfr-projector.

    allOf
    • #analytics
  • #8SiteSkuDemandChanged (consumed, order-management)

    One source order line's site/SKU demand became ACTIVE or REMOVED.

    Message IDSiteSkuDemandChanged

    order-management's PII-free demand projection (its ADR 0035, amended by its ADR 0044), restated here independently — never imported from its code. type = com.warehouse.wes.order-management.siteskudemand.SiteSkuDemandChanged, source /warehouse/order-management, dataschema urn:warehouse:order-management:events:SiteSkuDemandChanged:v1. Subject and Kafka key = <source_order_id>/line/<line_no> — the LINE is the stream identity, so one line's demand history is totally ordered on its own partition. state is ACTIVE (the line's demand exists at the site) or REMOVED (a cancellation took it away; demanded_units repeats the quantity it removes). due_at is the line's promise-group cutoff, else the order-level promise date. The consumer reads every field; no customer PII ever appears on this event.

    allOf
    • #consumed
  • #9BinStockLevelChanged (consumed, inventory-storage)

    The absolute on-hand and reserved level of one SKU in one bin changed.

    Message IDBinStockLevelChanged

    Producer change P1 is built: inventory-storage publishes this type (its ADR 0040). The contract was pinned here consumer-first. type = com.warehouse.wms.inventory-storage.stock.BinStockLevelChanged, source /warehouse/inventory-storage, dataschema urn:warehouse:inventory-storage:events:BinStockLevelChanged:v1. Subject and Kafka key = <bin>:<sku>. on_hand and reserved are ABSOLUTE levels after the change, not deltas; reserved is the units of this bin bound by active reservations. Keep the highest version per bin and SKU and ignore lower ones. The consumer reads only site_code, bin, sku, on_hand, reserved and version; reason is not read.

    allOf
    • #consumed
  • #10StockRelocated (consumed, inventory-storage)

    A quantity of one SKU moved from one bin to another bin of the same site.

    Message IDStockRelocated

    type = com.warehouse.wms.inventory-storage.stock.StockRelocated, dataschema urn:warehouse:inventory-storage:events:StockRelocated:v1. Subject and Kafka key = relocation_id. Restated from inventory-storage's contract (its ADR 0039), never imported. Act only when reason is REPLENISHMENT, a value inventory-storage added with producer change P4 (its ADR 0041; it also publishes SLOTTING, CONSOLIDATION and MANUAL); ignore every other reason.

    allOf
    • #consumed
  • #11SlotPlanApproved (consumed, slotting-optimization)

    A slot plan was approved; it is now the site's forward-slot map.

    Message IDSlotPlanApproved

    type = com.warehouse.wms.slotting-optimization.slotplan.SlotPlanApproved, source /warehouse/slotting-optimization, dataschema urn:warehouse:slotting-optimization:events:SlotPlanApproved:v1. Subject and Kafka key = the plan id. assignments is the FULL map of the plan.

    allOf
    • #consumed
  • #12ZoneRegistered (consumed, facility-layout)

    A behavioural zone was added inside a site's area.

    Message IDZoneRegistered

    type = com.warehouse.wms.facility-layout.zone.ZoneRegistered, source /warehouse/facility-layout, dataschema urn:warehouse:facility-layout:events:ZoneRegistered:v1. Subject and Kafka key = zoneId. data also carries eventName, eventType and occurredAt, which are ignored.

    allOf
    • #consumed
  • #13LocationSlotRegistered (consumed, facility-layout)

    A coded leaf slot now exists on the warehouse map.

    Message IDLocationSlotRegistered

    type = com.warehouse.wms.facility-layout.locationslot.LocationSlotRegistered, dataschema urn:warehouse:facility-layout:events:LocationSlotRegistered:v1. Subject and Kafka key = locationCode. An absent role means Storage. data also carries eventName, eventType and occurredAt, which are ignored.

    allOf
    • #consumed
  • #14LocationSlotDecommissioned (consumed, facility-layout)

    A coded slot was permanently retired.

    Message IDLocationSlotDecommissioned

    type = com.warehouse.wms.facility-layout.locationslot.LocationSlotDecommissioned, dataschema urn:warehouse:facility-layout:events:LocationSlotDecommissioned:v1. Subject and Kafka key = locationCode. Irreversible: the location is removed from the local copy.

    allOf
    • #consumed
  • #15product-master ProductPackLevelDeclared (consumed)

    A pack level (EACH, INNER, CASE or PALLET) of a SKU was declared, or one of its mutable attributes changed.

    Message IDProductPackLevelDeclared

    type = com.warehouse.wms.product-master.product.ProductPackLevelDeclared, source /warehouse/product-master, dataschema urn:warehouse:product-master:events:ProductPackLevelDeclared:v1; subject and key = the SKU. Produced by product-master; consumed into the local packaging view (pack level -> eaches factor for case-level scans). The keys are snake_case, exactly as product-master's encoder writes them (units_per_pack, effective_from, effective_to).

    allOf
    • #consumed
  • #16product-master ProductPackLevelRetired (consumed)

    A pack level of a SKU was retired.

    Message IDProductPackLevelRetired

    type = com.warehouse.wms.product-master.product.ProductPackLevelRetired, source /warehouse/product-master, dataschema urn:warehouse:product-master:events:ProductPackLevelRetired:v1; subject and key = the SKU. Produced by product-master; consumed into the local packaging view (retired levels are no longer valid scan targets).

    allOf
    • #consumed

Schemas

  • allOf
  • allOf
  • object
  • allOf
  • allOf
  • allOf
  • allOf
  • allOf
  • allOf
  • allOf
  • object
  • object
  • allOf
  • allOf
  • allOf
  • allOf