Overview
The problem this initiative solves
Business Onboarding & Smart Configuration
answers "how should this tenant's ERP be configured?" — it patches AppSettings groups (POS
behavior, discount rules, tax rules, cost-center document flags, and so on). It never creates a single
row of master data. A tenant leaving onboarding still has zero accounts, zero cost centers, zero
product categories, and zero products — every one of those has to be entered by hand before the tenant
can record a single transaction.
This initiative (Phase 4 through Phase 6C, 2026-07-15 to 2026-07-18) closes that second gap: SaaS-managed starter templates for the master data every tenant needs on day one, plus one Tenant Starter Kit orchestration endpoint that previews and applies all of them together.
The layer model
Three distinct layers, easy to conflate, kept deliberately separate throughout this initiative:
| Layer | Example | Lives in |
|---|---|---|
| Configuration | ProductSettings, FinancialSettings, CostCenterSettings — how the ERP behaves | Tenant dbo.AppSettings, patched by onboarding |
| Starter / master data | A chart of accounts, a set of cost centers, a product category tree, a base unit of measure | Tenant real business tables (dbo.Accounts, dbo.CostCenters, dbo.ProductCategories, dbo.Products, …), created by an explicit Preview → Apply flow |
| Operational data | Actual stock quantities, opening balances, real invoices, real prices, real barcodes | Tenant real business tables, created only by the tenant's own later use of the ERP (documents, not templates) |
Configuration is patched automatically (onboarding). Starter/master data is created only through an explicit, admin-triggered (or first-login-triggered) Preview/Apply call — never silently, never as a side effect of anything else. Operational data is never created by any part of this initiative at all — see Operational Boundaries.
What was built, in order
| Phase | Date | What it added |
|---|---|---|
| 4 | 2026-07-15 | Saas.BusinessActivities — formal master data for "what type of business is this tenant" |
| 5A / 5A.1 | 2026-07-15 | Accounting chart-of-accounts template catalog + JSON/Excel import |
| 5B.1 / 5B.1.1 | 2026-07-15 | Apply chart accounts to tenant dbo.Accounts; real Features.AccountManagement entitlement |
| 5B.2 | 2026-07-15 | Resolve chart-account mappings into tenant InventoryAccountCategory |
| 5B.3 | 2026-07-16 | Inventory account category templates + safe apply (closes the "zero rows" gap) |
| 5C | 2026-07-17 | Cost center templates + apply to tenant dbo.CostCenters |
| 5D | 2026-07-16 | Activity-specific Saudi/US-style default chart-of-accounts templates |
| 5E | (same window) | Tenant Starter Kit orchestration — composes the four accounting flows above |
| 5F / 5G | 2026-07-17 | Live E2E verification + SaaS admin authorization hardening (TenantAccessGuardBehavior) |
| 6 / 6A.1 / 6B | 2026-07-15 → 07-18 | Product Catalog templates: categories → prerequisites → items/units |
| 6C | 2026-07-18 | Product Catalog composed into the Tenant Starter Kit as a second, independent chain |
A schema-naming correction (SCHEMA_CONVENTION_CLEANUP, 2026-07-16) runs across this timeline too —
see Business Activities §"Naming convention" for what it fixed.
Design principles that hold across every phase
- SaaS DB owns templates, tenant DB owns real data. No template-apply service ever writes a tenant
database directly from MultiTenancyApi — every apply calls an internal, key-protected endpoint hosted
by
Shumoul.Api(BackEnd), which is the only process that ever opens a tenant database connection. - Insert-missing, never overwrite. Every apply flow in this initiative matches an existing tenant
row by a stable key (Code, or Name where the real table has no Code column) and only inserts what's
missing.
Force=truefills a currently-blank field on a match — it never overwrites a non-blank value, never touches a structural field, and never resurrects a soft-deleted row. - Preview never writes. Every Preview call runs the exact same resolution logic as Apply and reports what would happen — no tenant database write, no central apply-log row.
- Apply always logs. Every commit-mode Apply call writes exactly one row to a dedicated
Tenant*ApplyLogtable — whether it succeeded, partially succeeded, or failed outright. - Feature entitlement gates every apply.
Features.AccountManagementgates the accounting chain;Features.ProductsManagementgates the product chain. See Settings Groups and Entitlements. - Starter templates are not certified advice. Every accounting/cost-center template is explicitly labeled a starting point — "review with a licensed accountant before production use," never presented as final tax/legal/accounting guidance.
