Skip to main content
Version: Latest

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:

LayerExampleLives in
ConfigurationProductSettings, FinancialSettings, CostCenterSettings — how the ERP behavesTenant dbo.AppSettings, patched by onboarding
Starter / master dataA chart of accounts, a set of cost centers, a product category tree, a base unit of measureTenant real business tables (dbo.Accounts, dbo.CostCenters, dbo.ProductCategories, dbo.Products, …), created by an explicit Preview → Apply flow
Operational dataActual stock quantities, opening balances, real invoices, real prices, real barcodesTenant 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

PhaseDateWhat it added
42026-07-15Saas.BusinessActivities — formal master data for "what type of business is this tenant"
5A / 5A.12026-07-15Accounting chart-of-accounts template catalog + JSON/Excel import
5B.1 / 5B.1.12026-07-15Apply chart accounts to tenant dbo.Accounts; real Features.AccountManagement entitlement
5B.22026-07-15Resolve chart-account mappings into tenant InventoryAccountCategory
5B.32026-07-16Inventory account category templates + safe apply (closes the "zero rows" gap)
5C2026-07-17Cost center templates + apply to tenant dbo.CostCenters
5D2026-07-16Activity-specific Saudi/US-style default chart-of-accounts templates
5E(same window)Tenant Starter Kit orchestration — composes the four accounting flows above
5F / 5G2026-07-17Live E2E verification + SaaS admin authorization hardening (TenantAccessGuardBehavior)
6 / 6A.1 / 6B2026-07-15 → 07-18Product Catalog templates: categories → prerequisites → items/units
6C2026-07-18Product 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=true fills 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*ApplyLog table — whether it succeeded, partially succeeded, or failed outright.
  • Feature entitlement gates every apply. Features.AccountManagement gates the accounting chain; Features.ProductsManagement gates 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.