Add Khanegi default appearance snapshot seed and strip SA meta from get_user.

Mirrors Hamkar so each khanegi tenant can restore its factory ui-config without exposing defaultSnapshot publicly.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-03 21:13:46 +03:30
co-authored by Cursor
parent 3fa24ac965
commit b66e47c3b3
4 changed files with 225 additions and 3 deletions
+8 -1
View File
@@ -75,7 +75,8 @@ export class GetUserService {
product: tenant.product,
theme: themeMode,
mode: themeMode,
app_ui_config: tenant.product === 'khanegi' ? ui : undefined,
app_ui_config:
tenant.product === 'khanegi' ? this.stripKhanegiSaMeta(ui) : undefined,
/** Laravel-compatible overlay; Hamkar merges only when present */
ui_settings: uiSettings.length ? uiSettings : undefined,
};
@@ -86,6 +87,12 @@ export class GetUserService {
};
}
private stripKhanegiSaMeta(ui: Record<string, any> | null) {
if (!ui || typeof ui !== 'object') return ui;
const { defaultSnapshot: _snap, _backfill, ...rest } = ui;
return rest;
}
private buildHamkarUiSettings(ui: Record<string, any>): UiSetting[] {
const settings = ui?.settings;
if (!settings || typeof settings !== 'object') return [];