Skip to content

ER diagrams by domain (Mermaid)

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.

payment_for

user

order_service

APPLICATION

string

name

PK

string

company_name

BILLING

string

name

PK

string

status

string

service_type

USER

string

name

PK

ORDER_SERVICE

string

name

PK

Source: billing.jsonpayment_for → Application, user → User, order_service → Order Service.

Xero Invoice links to Xero Contact and Xero Tenants; line detail uses child Xero Invoice Items.

tenant_name

xero_contact

invoice_items

XERO_TENANTS

string

name

PK

XERO_INVOICE

string

name

PK

string

xero_invoice_id

string

status

XERO_CONTACT

string

name

PK

XERO_INVOICE_ITEMS

string

name

PK

Source: xero_invoice.json — options on Link fields; child table invoice_items → Xero Invoice Items.


Limitations (read before relying on diagrams)

Section titled “Limitations (read before relying on diagrams)”
LimitationDetail
Link fields onlyRelationships inferred from Link and child tables — dynamic links, scripts, or reports may add implicit joins not shown here.
Not cardinality-completeerDiagram simplifies; real DB may include optional fields, soft deletes, and historical rows.
NamingMermaid 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.

  1. Pick a cohesive cluster (e.g. a new integration DocType group).
  2. Extract Link targets from *.json under doctype/.
  3. Add a new ## Domain N section with erDiagram and a one-line _Source: citation.
  4. Run npm run build in docs/ to confirm Mermaid renders.