System Diagram

The Coastal Trading Licence & Voyage Management data model, mapped — 47 models, 133 relationships

🔍 For serious exploration, open the Interactive Diagram Viewer — pan, mouse-wheel zoom, fit-to-screen, full-screen, per-module tabs, the full 133-relationship ERD, and a focus mode that draws one model and its neighbours at a chosen depth. Organisation, Person, Port and Vessel are party / role / location columns that fan out to nearly everything, so the viewer hides those links by default — a toggle brings them back. The diagrams below are the readable, static summary of the principal links only.


Architecture Overview

Ten areas mirror the sidebar menu. Every arrow means "one row of the left model is referenced by many rows of the right model".

flowchart LR
    subgraph SCOPE["🧭 Scope"]
        CoastalTradeAssessment
        Section12Declaration
        Exemption
    end

    subgraph APP["📝 Application"]
        LicenceApplication --> ProposedVoyageMatter
        LicenceApplication --> ApplicationVessel
        LicenceApplication --> ApplicationDocument
        LicenceApplication --> ApplicationValidation
    end

    subgraph CONSULT["💬 Consultation"]
        LicenceApplication --> Publication
        LicenceApplication --> NoticeInResponse
        LicenceApplication --> ThirdPartyComment
        NoticeInResponse --> ApplicantResponse
        LicenceApplication --> InformationRequest
    end

    subgraph DEC["⚖️ Decision & licence"]
        LicenceApplication --> DelegateDecision --> Licence
        Licence --> LicenceVessel
        Licence --> LicenceCondition
    end

    subgraph AUTH["🗺️ Authorised voyages"]
        Licence --> AuthorisedVoyage
        ProposedVoyageMatter --> AuthorisedVoyage
        Licence --> VariationApplication --> VariationDecision
        VariationApplication --> VoyageMatterVariation
    end

    subgraph OPS["🚢 Operations"]
        AuthorisedVoyage --> Voyage
        Voyage --> PortCall
        Voyage --> CargoMovement
        Voyage --> PassengerMovement
        Voyage --> VoyageEvent
    end

    subgraph NR["📋 Notify · report · reconcile"]
        Voyage --> VoyageNotification --> VoyageNotificationAmendment
        Voyage --> VoyageReport
        Voyage --> VoyageReconciliation
        VoyageNotification --> VoyageReconciliation
        VoyageReport --> VoyageReconciliation
    end

    CoastalTradeAssessment --> LicenceApplication
    AuthorisedVoyage --> VoyageNotification
    AuthorisedVoyage --> VoyageReconciliation

The reconciliation node is deliberately fed by three arrows — AuthorisedVoyage, VoyageNotification and VoyageReport — because that three-way comparison is the system's headline control.


Compliance & Assurance

flowchart LR
    Voyage --> WageComplianceAssessment
    ComplianceObligation --> ComplianceTask
    Licence --> ComplianceTask
    Voyage --> ComplianceTask
    Licence --> ComplianceException
    Voyage --> ComplianceException
    ComplianceException --> CorrectiveAction

    Organisation --> RegulatoryCorrespondence
    Licence --> Evidence
    Voyage --> Evidence
    Organisation --> Audit --> AuditFinding
    CorrectiveAction --> AuditFinding
    Person --> Notification

Wage compliance hangs off the voyage (Schedule A for temporary-licence foreign-vessel voyages). The obligation catalogue generates tasks; detected exceptions drive corrective actions, which in turn can close an audit finding. The assurance layer is the evidence that outlives the voyage.


Parties & Fleet (the shared reference data)

flowchart LR
    Organisation --> Person
    Organisation --> Vessel
    Vessel --> VesselRegistration
    Organisation --> Port
    Commodity

Organisation, Person, Port, Vessel and Commodity are referenced from almost every operational model — an organisation as applicant / holder / owner / operator / charterer / shipper / consignee / agent / port authority; a person as assessor, delegate, contact, reviewer or corrective-action owner; a port as load, discharge or call location. Those high-fan-out links are hidden by default in the interactive viewer to keep the operational diagrams readable.


The interactive viewer's data block (modules, the full 133-edge ERD and the overview flow) is generated from schema/menu_config.yaml and generated/json/voyagemgnt_relationship_metadata.json by apps/voyagemgnt/scripts/build_diagram_viewer.py — re-run it after any DSL or menu change so the ERD always matches the schema.