Visits
Gate check-in, rejection and check-out.
Check a visit in at the gate (CheckInVisit)
Records a tractor and driver passing the gate and the trailers they bring. DirectOnCheckIn creates, per trailer, a move created already CLAIMED by the VISITING_DRIVER (no lease): to the appointment door when it is free, open and flow-compatible, otherwise to the first free spot of the site's parking zones, and a walk-in or an arrival earlier than the appointment tolerance goes to a holding spot (TO_HOLDING). SealCheckAtGate compares each recorded seal with the appointment's expected seal; a mismatch raises SealExceptionRaised and, under the REJECT policy, records a REJECTED visit instead (reason SEAL_MISMATCH). A refused check-in persists nothing: 409 `appointment-required`, `visit-already-open`, `trailer-already-on-site`, `door-closed`, `door-flow-mismatch`, `no-free-spot`, `placement-rule-violated`, `seal-class-too-low` (the site yard policy sets `minimumSealClass` and the seal is of a lower class or has none); 422 `invalid-carrier`, `unknown-appointment` (also when the visit names an appointment but does not carry exactly one trailer), `invalid-unit-number`, `invalid-seal-class`, `invalid-hazmat-class`, `invalid-un-number`, `validation`. The unit number of a `CONTAINER` trailer, and of any trailer whose `unitNumberScheme` is `ISO6346`, must be an ISO 6346 container number (4 letters: a 3-letter owner code and the category U, J or Z; 6 digits; the check digit), else 422 `invalid-unit-number` whose detail names the expected check digit; a domestic road trailer keeps a free-form number. A matching seal ends `VERIFIED` and a different one `MISMATCH` (ADR 0012). A trailer may declare what it carries: `hazmatClass`, `unNumber`, `requiresTemperatureControl` (ADR 0014). A trailer that declares a hazard class is placed only on a HAZMAT spot (a site with none refuses it, unless the policy sets `allowHazmatOnUnclassifiedSpots`, then only spots whose kind is unknown); a trailer that requires temperature control only on a REEFER_PLUG spot where the site has any. A site with no suitable free spot answers 409 `no-free-spot` (all taken) or `placement-rule-violated` (none exists); doors are exempt; a trailer that declares nothing, and a spot with no known kind, are judged as before. The gate clerk may then record the refusal with `POST /visit-rejections`. A carrier that dock-scheduling has suspended (the local copy of its registry, ADR 0016) is handled by the site yard policy `suspendedCarrierAction`: NONE admits the visit as before; FLAG admits it and sets the visit `carrierFlag` to SUSPENDED; REJECT records a REJECTED visit (reason CARRIER_SUSPENDED, VisitRejected published, no trailer persisted) and answers 409 `carrier-suspended`, so that turn-away is on record although the call is a 409.
List visits
Lists visits newest first, one keyset page at a time (`limit` 1-500, default 100; `cursor` is the opaque `nextCursor` of the previous page). Filters: `siteId`, `state`, `tractorPlate`. A query parameter this operation does not define is a 400 `unknown-query-parameter`.
Get a visit
Returns the visit with an `ETag` of its version.
Check a visit out (CheckOutVisit)
The visit leaves the site with `trailersOut`. Every trailer taken out must be on site and released: no open move and either PARKED or DOCKED with door work DONE (`trailer-not-released` 409), and every LOADED trailer of a LIVE_LOAD or PICKUP visit must carry a seal (`seal-required` 409). Each trailer departs (TrailerDeparted, and TrailerUndocked when it leaves a door); a trailer the visit brought and does not take stays PARKED (a drop). Only a CHECKED_IN visit checks out (409 `illegal-transition`). A DOCKED trailer that is still secured does not depart (409 `trailer-still-secured`, ADR 0013): release the securing first.
Turn a visit away at the gate (RejectAtGate)
Records a REJECTED visit and raises VisitRejected (consumed by dock-scheduling and exception-management). Nothing is persisted for the trailers.