01 — Quick Reference

Group Models
Submissions PortSubmission · SubmissionCargo · TransmissionAttempt · PortAcknowledgment · PortCorrection
Terminal Notices TerminalNotice
Reconciliation & Deadlines PortInterfaceReconciliation · TransmissionDeadline · PortInterfaceException
Audit PortInterfaceAudit
Profiles & Sources PortInterfaceAuthority · PortInterfaceProfile · PortInterfaceSnapshot

Every model (13) — one line each

Model It records Key foreign keys
PortInterfaceAuthority A (fictional) port authority or terminal operator —
PortInterfaceProfile A message profile: type, schema label, version, mode (SIMULATION default), transport label PortInterfaceAuthority
PortSubmission One electronic submission of a manifest revision (or a correction); status DRAFT … SUPERSEDED PortInterfaceProfile, itself (prior submission)
SubmissionCargo A positive effective manifest line as transmitted PortSubmission
TransmissionAttempt One simulated transport attempt (append-only); transport only, not acceptance PortSubmission
PortAcknowledgment The authority's response (append-only); RECORDED or QUARANTINED PortSubmission
PortCorrection A replacement that amends an ACCEPTED original; the original is kept PortSubmission (original, replacement)
TerminalNotice An external observation from a terminal; never changes a movement or a tally PortInterfaceAuthority
PortInterfaceReconciliation A discrepancy (rejected, partial, uncertain send, conflicting response ...) and its resolution with evidence PortSubmission, TerminalNotice
TransmissionDeadline The authority's deadline for a port call PortInterfaceProfile
PortInterfaceAudit Who did what, append-only —
PortInterfaceException A control exception (PORT_SUBMISSION_UNCONFIRMED ...) PortSubmission, TerminalNotice, TransmissionDeadline
PortInterfaceSnapshot What others told us (effective cargo, voyage, call, call mapping): versioned, hashed —

Vocabularies

  • PortSubmission.status: DRAFT → VALIDATED → APPROVED → SENT → ACCEPTED / REJECTED / UNCERTAIN → SUPERSEDED (UNCERTAIN → ACCEPTED / REJECTED after reconciliation)
  • PortSubmission.message_kind: ORIGINAL · CORRECTION; mode: SIMULATION · LIVE (none can be sent live in this build)
  • TransmissionAttempt.outcome: TRANSPORTED · TIMEOUT · AMBIGUOUS
  • PortAcknowledgment.outcome: ACCEPTED · REJECTED · PARTIAL; status: RECORDED · QUARANTINED; authenticity: SIMULATED · VERIFIED · FAILED
  • PortCorrection.status: PROPOSED · APPROVED · COMPLETED · CANCELLED
  • TerminalNotice.status: RECEIVED · VALIDATED · QUARANTINED
  • TransmissionDeadline.status: OPEN · MET · OVERDUE · WAIVED
  • PortInterfaceReconciliation.discrepancy_type: REJECTED_ACK · PARTIAL_ACK · UNCERTAIN_SEND · CONFLICTING_ACK · PAYLOAD_HASH_MISMATCH · NOTICE_CONFLICT · OTHER
  • PortInterfaceException.exception_type: SUBMISSION_REJECTED · SUBMISSION_UNCERTAIN · SUBMISSION_OVERDUE · PARTIAL_ACKNOWLEDGMENT · ACKNOWLEDGMENT_CONFLICT · STALE_REVISION · NOTICE_QUARANTINED · OTHER (control PORT_SUBMISSION_UNCONFIRMED)

Who may do what (pack permissions)

Role Transitions
operator (shipping_11_operator) validate · send · reconcile
supervisor (shipping_11_supervisor) approve · accept · reject · uncertain · supersede · resolve_rejection · quarantine

Messages (network member)

Commands accepted (orchestrator) portinterface.sweep_deadlines (added; the pack gives SHP-11 no command)
Events published portinterface.submission_status (ACCEPTED, REJECTED, UNCERTAIN, SUPERSEDED only; carries mode) · portinterface.terminal_notice (validated notices only) · portinterface.exception_raised · portinterface.exception_resolved
Events consumed manifest.effective_cargo · voyage.snapshot · voyage.portcall_snapshot · voyage.cargo_call_mapped · assurance.action_requested

Run, seed, regenerate

python server/run.py coast_11_portinterface                    # http://localhost:5195
python -m codegen.cli all coast_11_portinterface               # regenerate models, controllers and JSON after a schema change
python -m codegen.cli seed coast_11_portinterface --reset      # reload the sample data
python -m codegen.cli integration coast_11_portinterface       # regenerate the integration package (handlers.py is never overwritten)
python scripts/build_diagram_viewer.py coast_11_portinterface  # rebuild the interactive diagram