02 — System Diagram

🔍 Open the Interactive Diagram Viewer — pan, mouse-wheel zoom, fit-to-screen, full-screen, per-area tabs, the full ERD, and a focus mode that draws one model and its neighbours at a chosen depth. StorageExposure fans out to many tables, so its links can be hidden to declutter the overview.

Regenerate the viewer after any DSL, menu_config.yaml or diagram_config.yaml change: python scripts/build_diagram_viewer.py coast_14_demurrage.

Exposures & Clocks

flowchart LR
  STO0[StorageExposure] --> STO1[StorageSuspension]
  STO0[StorageExposure] --> STO2[StorageConcession]

Assessments

flowchart LR
  STO3[StorageAssessment] --> STO3[StorageAssessment]
  STO3[StorageAssessment] --> STO4[StorageAssessmentBand]

Entitlements & Billing

flowchart LR
  STO5[StorageEntitlement] --> STO5[StorageEntitlement]
  STO5[StorageEntitlement] --> STO6[StorageDispute]
  STO5[StorageEntitlement] --> STO7[StorageBillingAck]

Policies & Bands

flowchart LR
  STO8[StoragePolicy] --> STO9[StorageBand]

Exceptions & Audit

flowchart LR
  STO10[StorageException]
  STO11[StorageAudit]

Sources

flowchart LR
  STO12[StorageSourceSnapshot]
flowchart LR
  STO8[StoragePolicy] --> STO0[StorageExposure]
  STO0[StorageExposure] --> STO3[StorageAssessment]
  STO9[StorageBand] --> STO4[StorageAssessmentBand]
  STO0[StorageExposure] --> STO5[StorageEntitlement]
  STO3[StorageAssessment] --> STO5[StorageEntitlement]
  STO0[StorageExposure] --> STO10[StorageException]
  STO5[StorageEntitlement] --> STO10[StorageException]

No shared tables and no foreign keys: sibling applications are linked by canonical_ref strings, cid + ref pairs and messages. This application calculates the pre-tax entitlement; coast_05_rating taxes and invoices it, the finance interface posts it - the same charge is never produced in all three.

flowchart LR
  subgraph coast_14_demurrage
    EX[StorageExposure]
    AS[StorageAssessment]
    EN[StorageEntitlement]
    AK[StorageBillingAck]
    SN[StorageSourceSnapshot]
  end
  subgraph coast_03_tracking
    MV[TrackMovement]
  end
  subgraph coast_04_yard
    GT[GateTransaction]
  end
  subgraph coast_05_rating
    BS[Billing source and document]
  end
  subgraph coast_16_assurance
    AC[AssuranceCase]
  end
  MV -. "tracking.movement_accepted / _rejected (evidence)" .-> SN
  GT -. "yard.gate_recorded (evidence)" .-> SN
  SN -. "starts and stops the clock" .-> EX
  EN -. "storage.entitlement_approved (once, by id and hash)" .-> BS
  BS -. "rating.entitlement_acknowledged" .-> AK
  BS -. "rating.supplemental_detail_issued (invoice evidence)" .-> AK
  BS -. "rating.billing_document_issued (observation)" .-> SN
  EX -. "storage.exception_raised / _resolved" .-> AC
  AC -. "assurance.action_requested" .-> EX