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) andClient(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
Containerof aContainerSize, held by anOwner(the house fleet or an external lessor). - Voyages — a
VoyageServicebooks aVessel(with itsShippingCompanyandMaster) between twoPorts;Locations sit within ports. - Movements —
ContainerHistoryis the heart: every dated action on a box, tying together its container, voyage, action, status, manifest type, commodity, location and the shipper/consigneeClients. - Dockets — delivery, release and receival dockets hang off the movements that raised them.
- Demurrage — holds are charged against
DepotChargeRatebands intoDemurragePeriods, which bundle throughDemurrageInvoicePeriodinto aDemurrageInvoiceper client. - Clients & commodities — clients are typed and de-duplicated (with a
ClientAliasmap); 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.