4. Defaults Catalog
4.1 SaaS-side source of truth
One entity, TenantOperationalDefaultItem (Saas schema, Shumoul.Framework.MultiTenancy.Api), seeded
from one embedded JSON (TenantOperationalDefaults/TenantOperationalDefaultItems.json) via
TenantOperationalDefaultItemSeeder (ICustomSeeder, Priority 40 — runs last, since entitlement checks
happen live at apply time, not seed time, so there is no seed-order dependency). Gate-free: insert missing
by Code, fill only currently-blank Name/FName/PrintedTitle/FPrintedTitle on an existing row,
never touch Kind or any structural field on an already-existing row.
| Code | Kind | Name (Ar) | FName (En) |
|---|---|---|---|
DefaultWarehouse | Warehouse | المستودع الرئيسي | Main Warehouse |
DefaultCashAccount | CashAccount | الصندوق النقدي الرئيسي | Main Cash Box |
DefaultBankAccount | BankAccount | الحساب البنكي الرئيسي | Main Bank Account |
DefaultSalesInvoiceTemplate | SalesInvoiceTemplate | قالب فاتورة المبيعات الافتراضي | Default Sales Invoice Template |
4.2 Per-default detail
| Default | Tenant table | Required fields | Dependencies | Entitlement rule | Idempotency key |
|---|---|---|---|---|---|
| Warehouse | dbo.Warehouses | Name, FName | None | Features.ProductsManagement OR Features.PointofSalesApp OR Features.InventoryManagement | Tenant has zero existing Warehouse rows |
| CashAccount | dbo.CashAccounts | Name, FName | None (no GL/currency link at creation — see Chapter 5) | Features.PointofSalesApp OR Features.AccountManagement | Tenant has zero existing CashAccount rows |
| BankAccount | dbo.BankAccounts | Name, FName | None | Features.AccountManagement only | Tenant has zero existing BankAccount rows |
| SalesInvoiceTemplate | dbo.SalesInvoiceTemplates | Name, FName, PrintedTitle, FPrintedTitle (every other field uses the entity's own sensible C# defaults) | None | Features.PointofSalesApp OR Features.SalesManagement | Tenant has zero existing SalesInvoiceTemplate rows |
The idempotency key is deliberately "does the tenant have any row of this kind at all," not a
name/code match — matching the existing SeedWarehousesAsync/SeedDeviceAsync convention. This means an
admin who already created their own custom warehouse (different name) is correctly left alone; the
default is only ever created into a genuinely empty table.
4.3 What is deliberately never created
Per this phase's explicit scope boundary:
- No stock quantities, opening balances, inventory transactions, or stock movement documents.
- No accounting vouchers, journal entries, or GL account rows.
- No
CashAccountCurrency/BankAccountCurrencyGL-currency links (see Chapter 5). - No supplier/customer balances, market prices, or real barcodes.
- No IBAN/AccountCode on the created
BankAccount— a bare named placeholder only, filled in later by an admin if/when real banking details are known.
