System Diagram

The Container Movements data model, mapped — 29 models, 48 relationships

🔍 For serious exploration, open the Interactive Diagram Viewer — pan, mouse-wheel zoom, fit-to-screen, full-screen, per-module tabs, the full relationship ERD, and a focus mode that draws one model and its neighbours at a chosen depth. ContainerHistory (the movement fact table, 19 links) and Client (shipper / consignee / released-to / received-from, 12 links) fan out to nearly everything, so the viewer hides those links by default — a toggle brings them back. The diagram below is the readable, static summary of the principal links only.


Architecture Overview

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

flowchart LR
    subgraph FLEET["📦 Fleet"]
        Owner --> Container
        ContainerSize --> Container
    end

    subgraph VOY["🚢 Voyages"]
        ShippingCompany --> Vessel
        Master --> Vessel
        Vessel --> VoyageService
        Port --> VoyageService
        Port --> Location
    end

    subgraph MOVE["🔄 Movements"]
        Container --> ContainerHistory
        VoyageService --> ContainerHistory
        Action --> ContainerHistory
        ContainerStatus --> ContainerHistory
        ManifestType --> ContainerHistory
        Commodity --> ContainerHistory
        Location --> ContainerHistory
        Client --> ContainerHistory
    end

    subgraph DOCK["📋 Dockets"]
        ContainerHistory --> DeliveryDocket
        ContainerHistory --> ReleaseDocket
        ContainerHistory --> ReceivalsDocket
    end

    subgraph DEM["💰 Demurrage & invoicing"]
        ContainerSize --> DepotChargeRate
        Container --> DemurragePeriod
        Client --> DemurragePeriod
        DemurragePeriod --> DemurrageInvoicePeriod
        DemurrageInvoice --> DemurrageInvoicePeriod
        Client --> DemurrageInvoice
    end

    subgraph REF["🗂️ Clients & commodities"]
        ClientType --> Client
        ClientBusiness --> Client
        Client --> ClientAlias
        CommodityPrimaryCategory --> Commodity
        CommoditySubCategory --> Commodity
        CommodityType --> Commodity
    end

How to Read It

  • Fleet — every box is a Container of a ContainerSize, held by an Owner (the house fleet or an external lessor).
  • Voyages — a VoyageService books a Vessel (with its ShippingCompany and Master) between two Ports; Locations sit within ports.
  • MovementsContainerHistory is the heart: every dated action on a box, tying together its container, voyage, action, status, manifest type, commodity, location and the shipper/consignee Clients.
  • Dockets — delivery, release and receival dockets hang off the movements that raised them.
  • Demurrage — holds are charged against DepotChargeRate bands into DemurragePeriods, which bundle through DemurrageInvoicePeriod into a DemurrageInvoice per client.
  • Clients & commodities — clients are typed and de-duplicated (with a ClientAlias map); commodities are classified by category, subcategory and type.

The interactive viewer is generated from the live schema by apps/cmovements/scripts/build_diagram_viewer.py — re-run it after any DSL or menu_config change.