Domain deep dive — Incorporation & application
Purpose
Section titled “Purpose”Single D1 narrative for engineers working on incorporation, Application lifecycles, website / portal commerce, and PDF / DocuSign outputs. It ties together:
- Generated pages under Incorporation & application (the largest category in DocType reference)
- Application lifecycle & PDFs, Billing flow
- Incorporate website module and Tutorial: Billing → Xero
Domain boundary
Section titled “Domain boundary”| In scope | Out of scope (link instead) |
|---|---|
| Application master, officers, packages, orders, printouts | Full corporate secretarial AGM scheduler detail — AGM & scheduler, corporate-agm |
| Website content, FAQs, Singpass-facing tables | Deep Singpass API mechanics — Singpass |
| Orders, Billing, checkout → email | Core Sales Invoice GL design — ERPNext docs + Finance & AR |
| PDF generation, Printouts Table | External pdf.pregoi.com SLA — ops / vendor |
DocType cluster (generated)
Section titled “DocType cluster (generated)”The folder incorporation-application groups Application, Billing, Orders, package and service child tables, website FAQ/content, visa, virtual office, and more. Use the category index as a sitemap, not a runtime bounded context.
| Sub-theme | Examples |
|---|---|
| Core workflow | application, billing, orders, activity / activity_list |
| Commercial | package_types, orders, promotion_code, additional_services |
| Documents & PDFs | printouts_table, printouts_table_template, officer/shareholder child tables |
| Website | website_content, website_faq_*, singpass_myinfo |
| Services | virtual_office, secretary_service, registered_address_service, visa_* |
Code map
Section titled “Code map”| Layer | Primary locations |
|---|---|
| Application | lee_kim_alliance_erp/doctype/application/application.py, on_update/generate_pdfs.py |
| Hooks | hooks.py — Application on_update → generate_pdfs; Billing after_insert → tasks.handle_billing (Doc events) |
| Tasks / email | tasks.py — handle_billing, payment-success templates |
| Website | incorporate/ app, hooks.py website_redirects (Incorporate) |
| Integrations | DocuSign from Application context — DocuSign; payments — Stripe |
Sequence (simplified)
Section titled “Sequence (simplified)”Overlay priority (for overlays.json)
Section titled “Overlay priority (for overlays.json)”Keys are DocType folder names (snake_case). See docs/doctype-overlays/overlays.json and docs/doctype-overlays/README.md.
| Priority | DocType keys | Rationale |
|---|---|---|
| P1 — Overlays present | application, billing, orders, package_types, printouts_table | Head documents, commerce, PDF child rows |
| P2 | additional_services, website_faq_category, activity, virtual_office, orders_list | Frequent support; add overlays when incidents repeat |
| P3 | Narrow child tables (package feature tables, visa filters, etc.) | Field table + link to this page |
After editing overlays, run npm run generate:doctypes from docs/ and commit generated doctype-reference/** if your team tracks them.
Failure modes (where to look)
Section titled “Failure modes (where to look)”| Symptom | First checks |
|---|---|
| PDFs missing / wrong template | Application lifecycle — additional_context_generators, Printouts Table rows |
| Payment email not sent | Billing flow — status, service_type, payment_for |
| Website package mismatch | Package Types Stripe IDs vs dashboard; Orders payment_status / service_type |
| Redirect loop or wrong landing | hooks.py website_redirects, Incorporate |
Logs: Frappe Error Log, Console Log (PDF paths in application.py), server stderr for Python tracebacks.
Related
Section titled “Related”- Domain documentation strategy
- Domain deep dive — Finance & AR
- Domain deep dive — Payroll & HR
- Domain deep dive — Corporate AGM — Application-linked AGM compliance
- Domain deep dive — Automation & communications — payment / template emails
- Documentation upgrade roadmap
- Module catalog — Lee Kim Alliance ERP