Skip to main content

Events

dock-scheduling publishes fourteen event types and consumes ten, all as CloudEvents 1.0 (structured JSON mode) on Kafka. The contract is apis/asyncapi.yaml (AsyncAPI 2.6.0); the catalogue is guarded by TestEventCatalogueMatchesContract. The narrative and the policies behind each event are on Domain events.

Source: apis/asyncapi.yaml, internal/adapters/outbound/kafka/encoder.go (routeOf, the ADR 0004 catalogue), internal/adapters/kafka/cloudevents/cloudevents.go, internal/adapters/inbound/kafka/*_consumer.go, ADR 0004, ADR 0010, ADR 0012.

Envelope and delivery​

AttributeValue
specversion1.0
idUUID minted once when the fact is written to the outbox; a relay retry republishes the same id. Consumers dedupe on it.
source/warehouse/dock-scheduling
typecom.warehouse.wms.dock-scheduling.<entity>.<EventName>, entity dockappointment, dockcalendar or carrier
subject and Kafka keythe appointment id (appt-<uuid>), the site id for calendar events, or the SCAC for carrier events: one appointment's (or carrier's) history stays on one partition
timethe fact's occurred-at, UTC
datacontenttypeapplication/json; Kafka content-type header application/cloudevents+json; charset=UTF-8
dataschemaurn:warehouse:dock-scheduling:<stream>:<EventName>:v1, stream events or analytics
datasnake_case fields (below)

Topics: warehouse.dock-scheduling.events (integration events; contract for other contexts), warehouse.dock-scheduling.analytics (every published fact as a twin with the same id, type, key and data, only the dataschema stream segment differs, plus the analytics-only facts; read only by this service's projector), warehouse.dock-scheduling.events.dlq (rows that can never be encoded). Writes are acks=all with no topic fixed on the writer. Delivery is at-least-once; order is preserved per key, except that a row excluded by the attempt cap is overtaken by later rows (ADR 0005). The events channel carries seven types; the analytics channel carries all eleven.

Standard semantics on the facts (ADR 0013)​

Every appointment fact (and every door closure) can carry up to three optional data fields that say what the fact means in the standards partners read. Each is omitted (never null) when it has no honest value, so a fact with none of them is byte-for-byte the payload it was before, and the integration fact and its analytics twin carry identical data.

FieldMeaningValue
x12_statusthe ANSI X12 214 status codeAB Delivery Appointment Date and/or Time (INBOUND booked or rescheduled), AA Pick-up Appointment Date and/or Time (OUTBOUND booked or rescheduled), X1 Arrived at Delivery Location (INBOUND check-in), X3 Arrived at Pick-up Location (OUTBOUND check-in)
cbv_biz_stepthe GS1 EPCIS Core Business Vocabulary business step, URN formurn:epcglobal:cbv:bizstep:arriving (check-in)
read_point_glnthe GS1 GLN (13 digits) of the door where the fact happenedthe door's GLN as facility-layout registered it (ADR 0045 there), when it has one; closures carry only this field

Every other event (cancellation, no-show, door reassignment, completion, at-risk, the calendar and carrier facts) is decided NOT mapped to a code, with the reason, in ADR 0013; it carries only read_point_gln where it has a door with a GLN. The mapping is one table (internal/domain/standards) and the AsyncAPI declares the fields.

Published​

Appointment events (key appointmentId)​

EventFull typeStreamdata fieldsProducing commandConsumers
DockAppointmentBookedcom.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentBookedintegration + analytics twinappointment_id, site_id, direction, door_code, carrier, carrier_scac, window_start, window_end, asn_numbers, cpt_id, shipment_refs, expected_seal_number, arrival_tolerance_minutes, provenance, version; optional x12_status, read_point_glnBookAppointmentyard-management, warehouse-planning, inbound-receiving, outbound-shipping
DockAppointmentRescheduledcom.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentRescheduledintegration + analytics twinappointment_id, site_id, door_code, previous_door_code, window_start, window_end, previous_window_start, previous_window_end, arrival_tolerance_minutes, version; optional x12_status, read_point_glnRescheduleAppointment (window and/or door; carries previous_door_code)yard-management, warehouse-planning, inbound-receiving
DockAppointmentCancelledcom.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentCancelledintegration + analytics twinappointment_id, site_id, door_code, reason, versionCancelAppointment (carrier or planner request; policies CancelOnVisitRejected with TURNED_AWAY and CancelWhenAllAsnsCancelled with ASN_CANCELLED)yard-management, warehouse-planning, inbound-receiving
DockAppointmentNoShowcom.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentNoShowintegration + analytics twinappointment_id, site_id, door_code, direction, carrier_scac, window_end, versionMarkNoShow (policy NoShowSweep)yard-management, warehouse-planning, exception-management
DockAppointmentDoorReassignedcom.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentDoorReassignedintegration + analytics twinappointment_id, site_id, from_door_code, to_door_code, version; optional read_point_gln (the new door)ReassignDoor (policy ActualDoorWins)inbound-receiving
DockAppointmentCheckedIncom.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentCheckedInanalytics onlyappointment_id, site_id, door_code, checked_in_at, arrival_status, visit_id, version; optional x12_status, cbv_biz_step, read_point_glnRecordArrival (policy ArrivalFromGate)analytics only
DockAppointmentCompletedcom.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentCompletedanalytics onlyappointment_id, site_id, door_code, completed_at, versionRecordDoorRelease (policy CompleteOnDoorRelease)analytics only
DockAppointmentAtRiskcom.warehouse.wms.dock-scheduling.dockappointment.DockAppointmentAtRiskanalytics onlyappointment_id, site_id, door_code, eta_at, window_start, window_end, causeReportEta (policy EtaRisk), ReassignDoor (policy ActualDoorWins)analytics only

Calendar events (key siteId)​

EventFull typeStreamdata fieldsProducing commandConsumers
DoorClosureScheduledcom.warehouse.wms.dock-scheduling.dockcalendar.DoorClosureScheduledintegration + analytics twinsite_id, closure_id, door_code, from, to, reason, versionScheduleDoorClosureyard-management
DoorClosureLiftedcom.warehouse.wms.dock-scheduling.dockcalendar.DoorClosureLiftedintegration + analytics twinsite_id, closure_id, door_code, versionLiftDoorClosureyard-management
DoorOperatingHoursDeclaredcom.warehouse.wms.dock-scheduling.dockcalendar.DoorOperatingHoursDeclaredanalytics onlysite_id, door_code, operating_hours, versionDeclareOperatingHoursanalytics only

Carrier events (key scac, ADR 0012)​

EventFull typeStreamdata fieldsProducing commandConsumers
CarrierRegisteredcom.warehouse.wms.dock-scheduling.carrier.CarrierRegisteredintegration + analytics twinscac, name, usdot, mc, status, reason, suspended_at, version (the full snapshot)RegisterCarrier (first registration), UpdateCarriernone yet (yard-management planned)
CarrierSuspendedcom.warehouse.wms.dock-scheduling.carrier.CarrierSuspendedintegration + analytics twinscac, reason, suspended_at, versionSuspendCarriernone yet (yard-management planned)
CarrierReinstatedcom.warehouse.wms.dock-scheduling.carrier.CarrierReinstatedintegration + analytics twinscac, reinstated_at, versionReinstateCarriernone yet (yard-management planned)

A carrier fact raised by an MCP write also carries an optional initiated_by object in data (via, proposal_id, approved_by, agent_id); a REST write carries none.

Stream: integration + analytics twin is warehouse.dock-scheduling.events plus the same message on warehouse.dock-scheduling.analytics; analytics only is the analytics topic alone.

Enumerations used in the payloads: direction is INBOUND or OUTBOUND; arrival_status is EARLY, ON_TIME or LATE; reason of DockAppointmentCancelled is a CancellationReason (CARRIER_REQUEST, SITE_REQUEST, ASN_CANCELLED, TURNED_AWAY); cause of DockAppointmentAtRisk is an AtRiskCause (LATE_ETA, DOOR_REASSIGNED_OVERLAP).

"Analytics only" means no other context reads the event; the service's projector folds it into the adherence report. No context may depend on those events for a decision without an ADR. DockAppointmentDoorReassigned stopped being analytics only on 2026-11-09 (service ADR 0010): inbound-receiving keeps its copy of the appointment's door from it. Commands that raise no event: ReportEta (unless the ETA is late), DeclareCalendarSettings. DockAppointmentAtRisk carries no version; the REST appointment exposes atRisk and atRiskCause instead.

Consumed​

TopicFull typeHandler effect
warehouse.yard-management.eventscom.warehouse.wms.yard-management.yardvisit.VisitCheckedInRecordArrival
com.warehouse.wms.yard-management.yardvisit.VisitRejectedcancel with TURNED_AWAY
com.warehouse.wms.yard-management.trailer.TrailerDockedReassignDoor
com.warehouse.wms.yard-management.trailer.TrailerUndockedRecordDoorRelease
warehouse.facility.eventscom.warehouse.wms.facility-layout.zone.ZoneRegisteredzone copy
com.warehouse.wms.facility-layout.locationslot.LocationSlotRegistereddoor copy
com.warehouse.wms.facility-layout.locationslot.LocationSlotDecommissioneddoor deactivated
warehouse.inbound-receiving.eventscom.warehouse.wms.inbound-receiving.asn.ASNRegisteredASN copy
com.warehouse.wms.inbound-receiving.asn.ASNCancelledASN copy and CancelWhenAllAsnsCancelled
warehouse.process-path-management.eventscom.warehouse.wes.process-path-management.cptschedule.CPTScheduleChangedreplaces the site's cutoff copy

Consumer behaviour (CloudEvents only, dispatch on the full type, claim the id in processed_events, dead-letter to <topic>.dlq, retry transient failures) is on Integration. The projector additionally consumes this service's own analytics topic.