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. VoyageAccount 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_07_accounts.

Accounts & Statements

flowchart LR
  AGE0[AccountAgent] --> AGE1[AgencyAppointment]
  AGE1[AgencyAppointment] --> VOY2[VoyageAccount]
  VOY2[VoyageAccount] --> ACC3[AccountSource]
  VOY2[VoyageAccount] --> SET4[SettlementStatement]
  SET4[SettlementStatement] --> SET4
  VOY2[VoyageAccount] --> SET5[SettlementAdjustment]
  VOY2[VoyageAccount] --> SET6[SettlementDispute]
  ACC3[AccountSource] --> SET6[SettlementDispute]

Cash & Settlement

flowchart LR
  VOY2[VoyageAccount] --> AGE7[AgentCollection]
  AGE7[AgentCollection] --> COL8[CollectionAllocation]
  ACC3[AccountSource] --> COL8[CollectionAllocation]
  VOY2[VoyageAccount] --> AGE9[AgentPayment]
  ACC3[AccountSource] --> AGE9[AgentPayment]
  VOY2[VoyageAccount] --> AGE10[AgentCommission]
  VOY2[VoyageAccount] --> AGE11[AgentRemittance]
  VOY2[VoyageAccount] --> ACC12[AccountExchangeConversion]

Agency, control and projections

flowchart LR
  AGE1[AgencyAppointment] --> COL13[CollectionResponsibility]
  VOY2[VoyageAccount] --> ACC14[AccountAudit]
  EXC15[AccountException]
  EXT16[AccountExternalSnapshot]

No shared tables and no foreign keys: sibling applications are linked by string references and by messages. Names below are the integration contract (see schema/coast_07_accounts.integration.dsl).

flowchart LR
  subgraph coast_07_accounts
    SRC[AccountSource]
    AP[AgencyAppointment]
    ST[SettlementStatement]
    AX[AccountException]
  end
  subgraph coast_05_rating
    BD[BillingDocument]
  end
  subgraph coast_06_voyage
    VY[Voyage / port call]
  end
  subgraph coast_08_portcosts
    PC[Approved port cost]
  end
  subgraph coast_09_cartage
    CC[Approved cartage cost]
  end
  subgraph coast_16_assurance
    AC[AssuranceCase]
  end
  BD -. "rating.charge_detail_issued" .-> SRC
  PC -. "portcost.cost_approved" .-> SRC
  CC -. "cartage.cost_approved" .-> SRC
  VY -. "voyage.snapshot / portcall_snapshot" .-> SRC
  AP -. "accounts.appointment_changed" .-> VY
  ST -. "accounts.statement_issued" .-> AC
  AX -. "accounts.exception_raised" .-> AC