Skip to content

Critical paths — end-to-end flows

This page is the single hub for end-to-end understanding: from Desk / API through DocTypes and hooks to external systems, deployment, and failure modes. Use it after the Start guide when you must change behavior on a critical business path—not only read one integration page in isolation.

Each path below follows the same skeleton: domain narrativemodule & DocTypesintegrations & APIshooks / schedulersoperationsADRs.

Diátaxis quadrantWhere it lives for these flows
TutorialReading order, Scenario: Billing → Xero, Scenario: Payroll
How-toIntegration pages (Xero, Stripe, …), Operational runbook
ExplanationDomain — … pages, System overview, this hub
ReferenceDocType reference, API inventory

Generated DocType pages remain Reference only; procedural steps belong in How-to and domain pages (Domain documentation strategy).

Ops

Runbook

Environment matrix

Code & hooks

hooks.py

leekimerp/api/

Critical paths

Payments — Stripe

Payroll — SG HR

Finance — Xero AR

Incorporation — PDFs

Identity — Singpass


LayerLinks
ExplanationDomain — Finance & AR
How-toStripe integration
ReferenceAPI inventory (stripe modules), finance-ar-integrations DocTypes
Hooks / routesleekimerp/hooks.py (website_route_rules for webhooks), leekimerp/api/stripe.py, leekimerp/api/stripe_webhook.py
OperationsDeployment & operations, Operational runbook — webhook URLs, secrets in site config
DecisionsArchitecture decisions

Failure modes to rehearse: webhook signature mismatch, duplicate Payment Entry, guest API abuse — see Security checklist.


2. Payroll — Singapore HR → Salary Slip

Section titled “2. Payroll — Singapore HR → Salary Slip”
LayerLinks
ExplanationDomain — Payroll & HR, Payroll module
TutorialScenario: Singapore payroll
Referencepayroll-hr DocTypes, API inventory
HooksDoc eventsEmployee, Salary Slip, Payroll Entry; Schedulers
Scriptsleekimerp/scripts/salary_slip.py, leekimerp/hook_methods.py (verify in repo)
OperationsLong runs off-peak; scheduler logs — Operational runbook

LayerLinks
ExplanationDomain — Finance & AR
TutorialScenario: Billing → Xero
ModulesBilling flow, Xero tenant & contacts
How-toXero integration
Referencefinance-ar-integrations, API inventory (xero)
Codeleekimerp/api/xero.py
OperationsOAuth token refresh, webhook delivery — Environment matrix

4. Incorporation — Application lifecycle & PDFs

Section titled “4. Incorporation — Application lifecycle & PDFs”
LayerLinks
ExplanationDomain — Incorporation & application
ModuleApplication lifecycle & PDFs
How-toDocuSign where e-sign is in scope
Referenceincorporation-application DocTypes
HooksDoc eventsApplication on_update → PDF generation (see inventory table)
FlowsBusiness logic flows

LayerLinks
ExplanationDomain — Platform & admin
How-toSingpass integration
Referenceplatform-admin DocTypes, API inventory
SecuritySecurity checklist — guest and token surfaces