Skip to main content

Aggregate Design Canvas

Following the ddd-crew Aggregate Design Canvas v1.1. The model has six aggregate roots: YardVisit, Trailer, YardMove, YardCheck, Inspection and YardPolicy. Go packages, as built: internal/domain/yardvisit, trailer, yardmove, yardcheck, inspection, yardpolicy, plus shared (ids, Location, TrailerKind, LoadState, Purpose, SCAC). Ids are <prefix>-<uuid>: visit-, trl-, mv-, yck-, insp-; the policy is keyed by the site code. The aggregates are pure Go: Snapshot() and Restore() are the persistence boundary and Restore re-validates.

Common to all: every mutable aggregate carries an optimistic-concurrency version (starts at 1, +1 per accepted change; ETag / If-Match on REST), and errors are ErrNotFound (404), ErrIllegalTransition (409), ErrConcurrentModification (409) and ErrValidation (422) plus the domain errors named below. As built the status of a domain error is 409 for a conflict with state, 422 for a value or reference rule and 400 for a malformed request; the problem slug is the kebab-case of the Err name.

YardVisit​

1. Name​

YardVisit (yardvisit.Visit), identified by visitId.

2. Description​

One tractor and driver passing the gate, from check-in to check-out, with the trailers it brings and takes. Value objects: Carrier{name, scac?}, TractorPlate, DriverRef (opaque, no PII), Purpose(DROP|LIVE_UNLOAD|LIVE_LOAD|PICKUP|BOBTAIL), AppointmentRef?, TrailersIn[], TrailersOut[].

3. State Transitions​

Source: internal/domain/yardvisit/visit.go.

Omitted: the model's only transition is CHECKED_IN → CHECKED_OUT. The two creation arrows are CheckInVisit and RejectAtGate (a command that creates the aggregate has no from-state). A refused CheckInVisit creates nothing; RejectAtGate is the command that records a REJECTED visit (decision Y-5).

4. Enforced Invariants​

InvariantEnforced by
Carrier name non-blank, at most 100 characters; scac 2..4 upper-case letters when givenErrInvalidCarrier
At most one CHECKED_IN visit per tractor plate per siteErrVisitAlreadyOpen
A named appointment is in this site's local copy and the visit brings exactly one trailerErrUnknownAppointment
When the site requires appointments, the named appointment is BOOKED for this site in the local copyErrAppointmentRequired
Every trailer taken out is on site and released (no open move, and PARKED or DOCKED with door work DONE)ErrTrailerNotReleased
Every LOADED trailer taken out on an OUTBOUND purpose carries a sealErrSealRequired
The unit number of a CONTAINER (or of a unit declared ISO6346) is an ISO 6346 number with a correct check digit; other units stay free-formErrInvalidUnitNumber
A seal class is I, S or H; a seal below the site's minimumSealClass, or with no class, is refusedErrInvalidSealClass, ErrSealClassTooLow
A hazard class is a US DOT class or division, a UN number is UN and four digits and needs a hazard class (ADR 0014)ErrInvalidHazmatClass, ErrInvalidUNNumber, ErrValidation
A trailer with a hazard class is placed on a HAZMAT yard spot only (or, with no HAZMAT spot at the site and the policy allowHazmatOnUnclassifiedSpots, on a spot of unknown kind); a trailer that requires temperature control on a REEFER_PLUG spot where the site has any; doors are exempt (ADR 0014)ErrPlacementRuleViolated

The last two read Trailer and YardMove state, so they cross the aggregate boundary; the use case loads the trailers and checks them in one unit of work. The outbound purposes are LIVE_LOAD and PICKUP (decision Y-9), and a trailer is released when it has no open move and is either PARKED or DOCKED with door work DONE, so a live visit leaves from the door (decision Y-2).

5. Corrective Policies​

  • DirectOnCheckIn (this context): at CheckInVisit, a trailer with an appointment whose door is free, not closed and flow-compatible gets a VISITING_DRIVER move TO_DOOR; otherwise a move to the first free spot of the site's parking zones (by location code; nearest-to-door is phase 2); a walk-in or an arrival earlier than the tolerance goes TO_HOLDING.
  • VisitingDriverMove (this context): the first move of a trailer from the gate is created CLAIMED with performer VISITING_DRIVER (no lease).
  • SealCheckAtGate (this context): at check-in (not at RecordSeal), a seal on the trailer entry that differs from the appointment's expected_seal_number raises SealExceptionRaised; REJECT policy also rejects the visit.
  • ArrivalFromGate (dock-scheduling, a neighbour's reaction): on VisitCheckedIn naming an appointment, it records the arrival.

6. Handled Commands​

CommandIssued by
CheckInVisitGate clerk or kiosk, REST POST /visits
RejectAtGateGate clerk or kiosk, REST POST /visit-rejections
CheckOutVisitGate clerk or kiosk, REST POST /visits/{visitId}/check-outs

7. Created Events​

EventRaised whenFull CloudEvents type
VisitCheckedInCheckInVisit succeedscom.warehouse.wms.yard-management.yardvisit.VisitCheckedIn
VisitRejectedRejectAtGate succeeds (also the REJECT seal outcome)com.warehouse.wms.yard-management.yardvisit.VisitRejected
VisitCheckedOutCheckOutVisit succeedscom.warehouse.wms.yard-management.yardvisit.VisitCheckedOut (analytics only)

8. Throughput​

Estimate (from the model): medium (gate events). One check-in and one check-out per visit, no contended row.

9. Size​

Estimate (from the model): visits/day × retention. Each instance is small: scalars plus the in and out trailer lists. About two events per visit (one for a rejected visit).

Trailer​

1. Name​

Trailer (trailer.Trailer), identified by trailerId.

2. Description​

A towable unit on site (trailer, or container on a chassis): where it is, what it holds, its seal and hold. Value objects: TrailerKind(DRY_VAN|REEFER|FLATBED|CONTAINER), UnitNumber{carrier_scac, number, scheme} (natural key on site; ISO 6346 for a CONTAINER or a declared scheme, free-form otherwise; ADR 0012), LoadState(EMPTY|LOADED|PARTIAL), Contents{asn_numbers[] inbound, outbound_ref?}, Seal{number, state NONE|INTACT|BROKEN|APPLIED|VERIFIED|MISMATCH, class? I|S|H}, Hold{reason}, Location{kind SPOT|DOOR, code}, DoorWork(WAITING|IN_PROGRESS|DONE) (only while DOCKED), Securing{method RESTRAINT|WHEEL_CHOCKS, secured_at, securer_ref?} (only while DOCKED; the dock safety interlock, ADR 0013), Classification{hazmat_class?, un_number?, requires_temperature_control} (what the trailer carries, ADR 0014), ArrivedAt (the dwell clock start).

StartMoving and ArriveAt are invoked only by the YardMove use cases (claim and complete), in the same unit of work as the move, the fleet precedent of closing a receipt together with its ASN.

3. State Transitions​

Source: internal/domain/trailer/trailer.go, internal/domain/trailer/work.go.

Omitted: the creation arrow. RecordArrival creates the trailer IN_MOVE together with its first move, created CLAIMED (decision Y-1). A move that is cancelled or whose lease expires after the claim brings the trailer back through ReturnToOrigin (IN_MOVE to PARKED or DOCKED, where StartMoving found it) in the same unit of work; if that origin has since been taken the trailer stays IN_MOVE and the move REQUESTED. ArriveAt to a spot or a door is one command with two target states; the label says which. RecordSeal, BreakSeal, PlaceHold, ReleaseHold and RecordLoadState do not change the state.

Door work (the three values and the commands, as built):

WAITING → DONE is real: AutoCompleteUnload may complete door work that was never started, once every ASN on the trailer has a closed receipt (decision Y-7); CompleteDoorWork by an operator requires IN_PROGRESS (assumption A11).

4. Enforced Invariants​

InvariantEnforced by
A spot or door holds at most one trailer (domain service Occupancy.CheckFree under a per-location advisory lock, plus a partial unique index)ErrLocationOccupied
The location is a known, active Yard or Dock slot of the trailer's siteErrUnknownLocation
A door under a closure takes no trailerErrDoorClosed
A LOADED inbound trailer docks only at an Inbound or Both door, an outbound one only at an Outbound or Both doorErrDoorFlowMismatch
A trailer on hold is not dockedErrTrailerOnHold
A DOCKED trailer departs only when its door work is DONEErrDoorWorkOpen
Where the site policy requireSecuringBeforeDoorWork is on, door work starts only on a secured trailer (ADR 0013)ErrTrailerNotSecured
A secured trailer is not moved away from its door and does not depart until the securing is released; only a DOCKED trailer is secured (ADR 0013)ErrTrailerStillSecured
The natural key (scac, number) is unique among trailers on siteErrTrailerAlreadyOnSite

The first three and the fourth read other state (other trailers, the LocationView, the DoorClosureView, the door's dockFlow); the use case passes those in. See Occupancy across aggregates.

5. Corrective Policies​

  • CallToDoor (this context): on TrailerUndocked, the next BOOKED or CHECKED_IN appointment of that door whose trailer is PARKED gets a HOSTLER move TO_DOOR, due_by = window_start, priority by window_start.
  • AutoCompleteUnload (this context): on inbound-receiving ReceiptClosed for a receipt opened on an appointment whose trailer is DOCKED, CompleteDoorWork and set load_state EMPTY.
  • ClearDoorAfterWork (this context): on DoorWorkCompleted, a DROP trailer gets a HOSTLER move FROM_DOOR to a free spot; a LIVE trailer stays until its visit checks out.
  • SealCheckAtGate (this context): see YardVisit.
  • DwellSweep (this context): POST /dwell-sweeps raises TrailerDwellExceeded once per trailer and threshold crossing.
  • ActualDoorWins (dock-scheduling, a neighbour's reaction): on TrailerDocked at a door other than the booked one, it reassigns the door.
  • CompleteOnDoorRelease (dock-scheduling): on TrailerUndocked naming an appointment, it completes the appointment.

6. Handled Commands​

CommandIssued by
RecordArrivalCheckInVisit (one per trailer in TrailersIn, and one appointment covers exactly one trailer); no route of its own
StartMovingClaimNextMove use case, same unit of work as the claim
ArriveAtCompleteMove use case, same unit of work as the completion
StartDoorWorkDock operator, REST POST /trailers/{trailerId}/door-work-starts
CompleteDoorWorkDock operator, REST POST /trailers/{trailerId}/door-work-completions; AutoCompleteUnload
RecordSealYard supervisor, REST POST /trailers/{trailerId}/seals
BreakSealRecordSeal with state BROKEN, which also places a SEAL_BROKEN hold (decision Y-6); no route of its own
PlaceHoldYard supervisor, REST POST /trailers/{trailerId}/holds
ReleaseHoldYard supervisor, REST POST /trailers/{trailerId}/hold-releases
RecordLoadStateAutoCompleteUnload sets EMPTY; no route of its own
DepartCheckOutVisit for each trailer taken out (it raises TrailerUndocked first when the trailer is DOCKED)

7. Created Events​

EventRaised whenFull CloudEvents type
TrailerParkedArriveAt a spot (also ReturnToOrigin to a spot)com.warehouse.wms.yard-management.trailer.TrailerParked
TrailerDockedArriveAt a door (also ReturnToOrigin to a door)com.warehouse.wms.yard-management.trailer.TrailerDocked
DoorWorkStartedStartDoorWork succeedscom.warehouse.wms.yard-management.trailer.DoorWorkStarted
DoorWorkCompletedCompleteDoorWork succeedscom.warehouse.wms.yard-management.trailer.DoorWorkCompleted
TrailerUndockedthe trailer leaves a door: StartMoving or Depart from DOCKED (decision Y-6)com.warehouse.wms.yard-management.trailer.TrailerUndocked
TrailerDepartedDepart succeedscom.warehouse.wms.yard-management.trailer.TrailerDeparted
SealExceptionRaisedSealCheckAtGate finds a mismatchcom.warehouse.wms.yard-management.trailer.SealExceptionRaised
TrailerHeldPlaceHold succeedscom.warehouse.wms.yard-management.trailer.TrailerHeld
TrailerHoldReleasedReleaseHold succeedscom.warehouse.wms.yard-management.trailer.TrailerHoldReleased
TrailerDwellExceededDwellSweep crosses a thresholdcom.warehouse.wms.yard-management.trailer.TrailerDwellExceeded

RecordArrival, RecordSeal, BreakSeal and RecordLoadState raise no event of their own in the model.

8. Throughput​

Estimate (from the model): high (every move and door step). Two trailer writes per move (claim, complete), plus door-work steps. The contended resource is a location: one door wanted by two moves. As built: per-location advisory lock, partial unique index as backstop (uq_trailers_one_per_location, uq_trailers_unit_on_site), optimistic concurrency on version.

9. Size​

Estimate (from the model): trailers on site (hundreds per site) plus history. Each instance is small. The model gives no event count; this page's estimate for one dock cycle is about six (parked, docked, door work started, door work completed, undocked, departed, plus a parked or docked and an undocked per extra move).

YardMove​

1. Name​

YardMove (yardmove.Move), identified by moveId.

2. Description​

One instruction to take a trailer from where it is to a spot, a door or the gate, done by a hostler or by the visiting driver. Value objects: Performer(HOSTLER|VISITING_DRIVER), From/To Location{kind, code}, Priority{band 1..9, due_by}, Reason(TO_DOOR|FROM_DOOR|RELOCATE|TO_HOLDING), Lease{hostler_ref, expires_at}.

3. State Transitions​

Source: internal/domain/yardmove/yardmove.go, internal/application/usecases/gate_checkin.go.

Omitted: the creation arrow into REQUESTED is RequestMove. The arrow into CLAIMED comes from the policy text ("created CLAIMED with performer VISITING_DRIVER") and is not in transitions. A CLAIMED visiting-driver move has no lease, so it can neither expire nor be cancelled; the dock operator or gate clerk completes it through the same completion route (decisions Y-1, Y-3).

4. Enforced Invariants​

InvariantEnforced by
A trailer has at most one REQUESTED or CLAIMED moveErrTrailerHasOpenMove
No two open moves share a destination, and the destination is free when requestedErrDestinationReserved
A hostler holds at most one CLAIMED moveErrHostlerBusy
Only the lease holder completes a CLAIMED moveErrNotLeaseHolder
Completion records the actual location; a location other than the destination needs a reasonErrUnexplainedDestination

The first, second and third span moves (and, for "free", trailers). Enforcement as built: partial unique indexes on open moves per trailer, per destination and per hostler (uq_yard_moves_one_open_per_trailer, uq_yard_moves_open_destination, uq_yard_moves_one_claim_per_hostler), and Occupancy.CheckFree for "the destination is free". See Occupancy across aggregates.

5. Corrective Policies​

  • CallToDoor, ClearDoorAfterWork, DirectOnCheckIn (this context): create moves (see Trailer and YardVisit).
  • LeaseExpirySweep (this context): POST /move-lease-sweeps returns expired CLAIMED moves to REQUESTED.
  • NoShowFreesHolding (this context): on DockAppointmentNoShow or DockAppointmentCancelled, an open TO_DOOR move for that appointment is cancelled. A move carries the appointment_id of its appointment (decision X3), which is how the policy finds it.
  • VisitingDriverMove (this context): the first move from the gate is created CLAIMED, performer VISITING_DRIVER, no lease; the dock operator or gate clerk completes it. Departures leave from a spot or, for a live visit, from the door; there is no move to the gate.

6. Handled Commands​

CommandIssued by
RequestMoveYard supervisor, REST POST /moves; policies DirectOnCheckIn, CallToDoor, ClearDoorAfterWork
ClaimNextMoveHostler, REST POST /moves/claims
CompleteMoveHostler, REST POST /moves/{moveId}/completions; dock operator or gate clerk for a VISITING_DRIVER move (same route, decision Y-3)
CancelMoveYard supervisor, REST POST /moves/{moveId}/cancellations; policy NoShowFreesHolding
ExpireLeaseScheduler (cron), REST POST /move-lease-sweeps

7. Created Events​

EventRaised whenFull CloudEvents type
YardMoveRequestedRequestMove succeeds (also the first move at the gate)com.warehouse.wms.yard-management.yardmove.YardMoveRequested
YardMoveClaimedClaimNextMove succeedscom.warehouse.wms.yard-management.yardmove.YardMoveClaimed
YardMoveLeaseExpiredExpireLease succeedscom.warehouse.wms.yard-management.yardmove.YardMoveLeaseExpired
YardMoveCompletedCompleteMove succeedscom.warehouse.wms.yard-management.yardmove.YardMoveCompleted
YardMoveCancelledCancelMove succeedscom.warehouse.wms.yard-management.yardmove.YardMoveCancelled

All five are analytics only. YardMoveLeaseExpired is new as built (decision Y-10); the type strings above replace the earlier MoveRequested style, which was never the contract.

8. Throughput​

Estimate (from the model): high. Hostlers poll ClaimNextMove; two hostlers may reach for the same move, and two requests may name one destination. As built, the claim is ordered by lowest priority band, then earliest due_by (none last), then request time (decision Y-11, assumption A14), with a unique index of one CLAIMED move per hostler as the backstop and optimistic concurrency on version.

9. Size​

Estimate (from the model): moves/day × retention. Small; at most four events per instance (requested, claimed, completed or cancelled), plus any lease expiry, which raises none.

YardCheck​

1. Name​

YardCheck (yardcheck.Check), identified by yardCheckId.

2. Description​

A yard audit: walk the spots and doors, record what is really there, reconcile with the model. Value objects: Observation{location_code, unit_number?}, Discrepancy{kind MISSING|UNEXPECTED|WRONG_LOCATION, location_code, trailer_id?, unit_number?}.

3. State Transitions​

Source: internal/domain/yardcheck/yardcheck.go.

Omitted: the creation arrow is OpenYardCheck (a command, not a model transition).

4. Enforced Invariants​

InvariantEnforced by
At most one OPEN yard check per siteErrYardCheckOpen
A location is observed at most once per checkErrLocationAlreadyObserved

5. Corrective Policies​

None in the model. Closing computes the discrepancies and publishes them; no command applies a discrepancy to a Trailer: closing only reports (decision Y-11), and a location that was not observed is MISSING when the model records a trailer there. exception-management opens one case per discrepancy (fleet_changes).

6. Handled Commands​

CommandIssued by
OpenYardCheckYard supervisor, REST POST /yard-checks
RecordObservationYard supervisor, REST POST /yard-checks/{yardCheckId}/observations
CloseYardCheckYard supervisor, REST POST /yard-checks/{yardCheckId}/closures

7. Created Events​

EventRaised whenFull CloudEvents type
YardCheckClosedCloseYardCheck succeedscom.warehouse.wms.yard-management.yardcheck.YardCheckClosed

8. Throughput​

Estimate (from the model): low. One check per site per shift; observations arrive as the supervisor walks the yard.

9. Size​

Estimate (from the model): one per site per shift. Up to one observation per location; one event per instance.

Inspection​

1. Name​

Inspection (inspection.Inspection), identified by inspectionId (insp-<uuid>); its checklist is an immutable inspection.Template keyed by (templateId, version) (ADR 0015).

2. Description​

A checklist filled in for a trailer on site. Value objects: Gate(PRE_DOCK|PRE_LOAD|PRE_DEPARTURE|ON_DEMAND), Item{code, text, required, allow_not_applicable, hold_reason, result PASS|FAIL|NOT_APPLICABLE, note?, evidence_refs[]} (a snapshot of the template version taken at open), ConditionGrade(CLEAN|DIRTY|ODOUR|DAMAGED), performer_ref. Built-in templates: tractor-trailer-17-point, empty-container-7-point, reefer-pre-cool-and-sanitation.

3. State Transitions​

OPEN to PASSED or FAILED on completion, and no further change: FAILED when a required item failed.

4. Enforced Invariants​

InvariantError
Results change only while OPEN; completion is finalErrInspectionClosed
Every required item has a result before completionErrRequiredItemPending
NOT_APPLICABLE only where the item allows it; the item must existErrNotApplicableNotAllowed, ErrUnknownItem
At most one OPEN inspection per trailer, template and gate (partial unique index)ErrInspectionAlreadyOpen
A published template version is never rewritten; built-ins are read-onlyErrTemplateVersionImmutable, ErrTemplateIsBuiltIn
The template (version) named must existErrUnknownTemplate

5. Corrective Policies​

A FAILED completion holds the trailer in the same unit of work (reason of the most severe failed required item; a trailer already held or departed is left as it is). Site policy requiredInspections makes the next step ask for a PASSED one: ErrInspectionRequired / ErrInspectionFailed (the latest completed inspection of the template at the gate decides).

6. Handled Commands​

OpenInspection, RecordInspectionItem, CompleteInspection, PublishInspectionTemplate.

7. Created Events​

InspectionCompleted (every completion) and, after it, InspectionFailed (a failed one); both integration, advisory (no version).

8. Throughput​

A handful of inspections per trailer visit; the per-trailer reads behind each gate use the (trailer_id, completed_at) index.

9. Size​

One row per inspection; the item snapshot is JSON of at most 100 items.

YardPolicy​

1. Name​

YardPolicy (yardpolicy.Policy), identified by siteId.

2. Description​

The per-site yard rules every gate and move decision reads. Value objects: require_appointment (bool), holding_spot_codes[], parking_zone_ids[]; dwell_threshold_minutes per TrailerKind, lease_seconds, seal_mismatch_action (FLAG or REJECT); free_time_minutes (detention clock, optional, no default); minimum_seal_class (I, S or H, optional: a lower class at check-in or record-seal is refused); require_securing_before_door_work (bool, default false: door work starts only on a secured trailer, ADR 0013); required_inspections[] ({gate, template_id, purposes?, trailer_kinds?}, default empty: a PASSED inspection before a door move, loading or check-out, ADR 0015); allow_hazmat_on_unclassified_spots (bool, default false, ADR 0014). Defaults as built: require_appointment false, seal_mismatch_action FLAG, lease_seconds 300, no free time and no dwell thresholds (a kind without a threshold is never alerted).

3. State Transitions​

Source: internal/domain/yardpolicy/yardpolicy.go.

Omitted: the self-arrow is PUT replacing the settings (If-Match is honoured). A site that never declared a policy answers the defaults above, as version 1.

4. Enforced Invariants​

InvariantEnforced by
Holding spots are known Yard slots of the siteErrUnknownLocation
Thresholds and lease are positiveErrValidation

5. Corrective Policies​

None. Other policies read it: DirectOnCheckIn (holding spots, parking zones, require_appointment), SealCheckAtGate (seal_mismatch_action), DwellSweep (thresholds), the claim use case (lease_seconds).

6. Handled Commands​

CommandIssued by
DeclareYardPolicyYard supervisor, REST PUT /sites/{siteId}/yard-policy

7. Created Events​

None (events: []). Its effect shows in the decisions that read it.

8. Throughput​

Estimate (from the model): low. Supervisor edits; read on every check-in and claim.

9. Size​

Estimate (from the model): one per site.

Occupancy across aggregates​

The business decision "a spot or a door holds at most one trailer" is not inside one aggregate. It spans every Trailer of a site and the open YardMoves that have reserved a destination. The model puts the rule in a domain service, Occupancy.CheckFree, under a per-location advisory lock, with a partial unique index as backstop.

MomentCheckErrorSource
RequestMoveThe destination is free and no other open move names itErrDestinationReservedYardMove invariant
RequestMoveThe trailer has no other open moveErrTrailerHasOpenMoveYardMove invariant
ClaimNextMoveThe hostler holds no other CLAIMED move; the trailer goes IN_MOVE and its origin place is released (decision Y-8, assumption A3)ErrHostlerBusyYardMove invariant
CompleteMove (ArriveAt)Occupancy.CheckFree on the actual location, under the lockErrLocationOccupiedTrailer invariant
CompleteMove (ArriveAt)Known, active slot; door not closed; door flow allows the trailer; trailer not on holdErrUnknownLocation, ErrDoorClosed, ErrDoorFlowMismatch, ErrTrailerOnHoldTrailer invariants
CompleteMoveA location other than the destination needs a reasonErrUnexplainedDestinationYardMove invariant
CheckOutVisitEvery trailer out is released (no open move, and PARKED or DOCKED with door work DONE)ErrTrailerNotReleasedYardVisit invariant

Source: internal/domain/trailer/trailer.go, internal/domain/trailer/work.go, internal/domain/yardmove/yardmove.go.

Omitted: the origin place is released at StartMoving, the destination was reserved at RequestMove and is validated again at ArriveAt; an occupied location is refused and the move stays CLAIMED (decision Y-8, assumption A3). The model uses two error names for "not free": ErrDestinationReserved when requesting and ErrLocationOccupied when arriving, and the service follows that split.

Read models​

Read modelSource eventsUsed forWhy it is not an aggregate
LocationViewfacility-layout LocationSlotRegistered (role Yard or Dock, dockFlow), LocationSlotDecommissioned, ZoneRegistered (zoneId → siteCode)ErrUnknownLocation, ErrDoorFlowMismatch, the site of a door or spot, free-spot search by location codeA copy of facility-layout's registry; this context enforces no rule on it.
AppointmentViewdock-scheduling DockAppointmentBooked, DockAppointmentRescheduled, DockAppointmentCancelled, DockAppointmentNoShowErrAppointmentRequired, DirectOnCheckIn, CallToDoor, SealCheckAtGate (expected_seal_number), NoShowFreesHoldingA copy of dock-scheduling's appointments; it never changes them. It marks itself CHECKED_IN from the yard's own VisitCheckedIn and USED from its own TrailerUndocked (decision X4).
DoorClosureViewdock-scheduling DoorClosureScheduled, DoorClosureLiftedErrDoorClosed, DirectOnCheckInA copy of dock-scheduling's closures.
AsnContentViewinbound-receiving ASNRegistered, ASNCancelledWhat an inbound trailer holds (Contents.asn_numbers)A projection of another context's ASNs.
ReceiptAtDoorViewinbound-receiving ReceiptOpened (receipt_id, appointment_id, door_code), ReceiptClosedAutoCompleteUnloadA projection of receipts at a door; it decides nothing alone.
YardBoardOwn Trailer and YardMove stateThe live spot and door map (GET /sites/{siteId}/yard-board)A read side of this context's own aggregates.
the analytics reportsOwn events on the analytics topicDwell by kind, door utilisation, moves per hostler hour, driver wait (arrival to door work started)A projection of facts; it decides nothing.

Source: internal/application/views/views.go.