ER diagrams by domain (Mermaid)
Purpose
Section titled “Purpose”These Mermaid erDiagram blocks summarize relationships implied by Link and child table fields in leekimerp/**/doctype/*/*.json. They are handover aids, not a substitute for a full ERD tool or database reverse-engineering.
For column-level detail use DocType reference (generated field tables).
Domain 1 — Application, billing, and orders
Section titled “Domain 1 — Application, billing, and orders”Core paths: Application as the business hub; Billing records payments; links to User and Order Service per JSON.
Source: billing.json — payment_for → Application, user → User, order_service → Order Service.
Domain 2 — Xero invoice mirror
Section titled “Domain 2 — Xero invoice mirror”Xero Invoice links to Xero Contact and Xero Tenants; line detail uses child Xero Invoice Items.
Source: xero_invoice.json — options on Link fields; child table invoice_items → Xero Invoice Items.
Related
Section titled “Related”Limitations (read before relying on diagrams)
Section titled “Limitations (read before relying on diagrams)”| Limitation | Detail |
|---|---|
| Link fields only | Relationships inferred from Link and child tables — dynamic links, scripts, or reports may add implicit joins not shown here. |
| Not cardinality-complete | erDiagram simplifies; real DB may include optional fields, soft deletes, and historical rows. |
| Naming | Mermaid entity names are uppercase labels for readability; Frappe DocType names may differ in spacing and casing. |
When migrating data or writing SQL, use DocType JSON and MariaDB schema as the final authority.
Adding a new domain diagram
Section titled “Adding a new domain diagram”- Pick a cohesive cluster (e.g. a new integration DocType group).
- Extract Link targets from
*.jsonunderdoctype/. - Add a new
## Domain Nsection witherDiagramand a one-line_Source:citation. - Run
npm run buildindocs/to confirm Mermaid renders.