02 — System Diagram

🔍 Open the Interactive Diagram Viewer — pan, zoom, per-area tabs, the full ERD and a focus mode. PurchaseOrder is the hub table, 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 purchasing.

flowchart TD
  PR[PurchaseRequirement]
  PA[PurchaseApproval]
  PO[PurchaseOrder]
  POL[PurchaseOrderLine]
  ACK[SupplierAcknowledgement]
  DC[DeliveryCommitment]
  SH[Shipment]
  SHL[ShipmentLine]
  EX[ProcurementException]
  HIST[ProcurementStatusHistory]

  PR --> PO
  PR --> PA
  PO --> PA
  PO --> POL
  PO --> ACK
  POL --> DC
  DC -- supersedes --> DC
  PO --> SH
  SH --> SHL
  POL --> SHL
  PO --> EX
  PR --> EX

ProcurementStatusHistory names the requirement or order by its number, not by a foreign key.

Where it sits in the network (R1 / R1b)

sequenceDiagram
  participant W as Work Management
  participant O as Orchestrator
  participant I as Inventory
  participant P as Purchasing
  W->>O: work.material_requirement_created
  O->>I: deliver
  I->>O: inventory.item_unavailable
  O->>W: deliver (work order awaiting parts)
  O->>P: deliver
  P->>P: raise PR-…
  P->>O: purchasing.requirement_created
  O->>W: deliver (requirement shows PR-…, status purchasing)
  Note over P: order placed, supplier commits a date
  P->>O: purchasing.delivery_commitment_changed (+ delivery_delayed when at risk)
  O->>W: deliver (Expected Available updated, delay noted)
  O->>I: deliver (acknowledged)