feat(program-settings): expose tenant settings APIs and merge PATCH by key

Sold apps can read settings from /get_settings; Super Admin saves only changed keys so huge runtime logs are not sent in the body.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-17 17:07:46 +03:30
co-authored by Cursor
parent 25c0a4e941
commit 8f9988eb15
11 changed files with 320 additions and 11 deletions
@@ -0,0 +1,20 @@
/** کلیدهای runtime / لاگ — مال سوپرادمین نیستند؛ در اپ خانگی توسط cron پر می‌شوند. */
export const RUNTIME_PROGRAM_SETTING_KEYS = new Set([
'montzar_last_product_log',
'montzar_order_response',
'montzar_live_price',
'montzar_mazaneh',
'montzar_diff',
'montzar_truly_buy_mazaneh',
'montzar_truly_sell_mazaneh',
'montzar_token',
'montzar_closed',
'up_price',
'down_price',
'price_extreme_date',
'do_send_liman',
]);
export function isRuntimeProgramSettingKey(keyRaw: string): boolean {
return RUNTIME_PROGRAM_SETTING_KEYS.has(String(keyRaw || '').trim());
}