6. Backend Modules
6.1 Shumoul.MultiTenancyApi (Shumoul.Framework.MultiTenancy.Api)
| Module | Location | Responsibility |
|---|---|---|
OnboardingController | Controllers/OnboardingController.cs | The 6 public api/v1/onboarding/* endpoints |
OnboardingService / IOnboardingService | Onboarding/OnboardingService.cs | Status, survey retrieval, answer merging, recommendation orchestration, apply orchestration, skip |
OnboardingRecommendationService | Onboarding/ | Rules engine — evaluates OnboardingRules against a session's answers to pick a profile and build the settings patch, summary, warnings, and next actions |
HttpOnboardingTenantSettingsApplier / IOnboardingTenantSettingsApplier | Onboarding/HttpOnboardingTenantSettingsApplier.cs | Calls the BackEnd internal bridge over HTTP and returns before/after/applied-patch JSON back to OnboardingService |
OnboardingApplyBridgeSettings | Onboarding/OnboardingApplyBridgeSettings.cs | Bound config: Enabled, BackEndBaseUrl, ApplySettingsPath, InternalApiKey, TimeoutSeconds |
OnboardingSurveySeeder | Onboarding/OnboardingSurveySeeder.cs | Seeds the default survey (default-business-setup), its questions, profiles, and rules on startup |
OnboardingCurrentUserPermissionsService | Identity/OnboardingCurrentUserPermissionsService.cs | Claims-based ICurrentUserPermissionsService implementation — see Chapter 9 |
TenantPermissions.Onboarding | Constants/TenancyPermissions.cs | The 4 permission constants (View, Answer, Apply, Skip) |
6.2 Shumoul.BackEnd
| Module | Location | Responsibility |
|---|---|---|
OnboardingInternalController | Shumoul.Api/Controllers/Internal/OnboardingInternalController.cs | The single internal, service-to-service endpoint; validates the internal key, delegates to the patch service |
IInternalOnboardingSettingsPatchService / InternalOnboardingSettingsPatchService | Shumoul.Application/Interfaces/Shared/ · Shumoul.Infrastructure/Services/InternalOnboardingSettingsPatchService.cs | The settings patch engine — see Chapter 11 |
InternalServiceAuthSettings | Shumoul.Application/Settings/InternalServiceAuthSettings.cs | Bound config: OnboardingApplyApiKey |
ApplyOnboardingSettingsPatchInternalRequest / ...Response | Shumoul.Application/DTOs/Onboarding/ | The internal bridge's request/response contract |
IAppSettingService | Shumoul.Application/Interfaces/Services/ (pre-existing) | The one official settings read/write/cache-clear service every onboarding-applied setting goes through — no new persistence mechanism was introduced |
6.3 What was deliberately not built
- No new AppSettings storage mechanism — onboarding writes through the exact same
IAppSettingService.GetAppSetting<T>()/SetAppSetting<T>()every other feature uses. - No duplicate tenant-database connection logic in
Shumoul.MultiTenancyApi— it never touches a tenant's ERP database directly. - No new authentication system — onboarding uses the same JWT every other ERP endpoint uses (see Chapter 9).
