feat(settings): store Khanegi keys in settings tables instead of tenant JSON

Template defaults seed from deploy_settings_const; new tenants copy them, import decides per key, and /get_settings reads the per-tenant rows.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-17 20:14:17 +03:30
co-authored by Cursor
parent 8f9988eb15
commit d57ce0a3cb
15 changed files with 2659 additions and 354 deletions
@@ -1,4 +1,15 @@
import { IsString, MaxLength, MinLength } from 'class-validator';
import { Allow, IsArray, IsIn, IsOptional, IsString, MaxLength, MinLength, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';
export class ImportDecisionDto {
@IsString()
@MinLength(1)
@MaxLength(50)
key!: string;
@IsIn(['none', 'this', 'all'])
scope!: 'none' | 'this' | 'all';
}
export class ImportProgramSettingsDto {
@IsString()
@@ -10,4 +21,15 @@ export class ImportProgramSettingsDto {
@MinLength(1)
@MaxLength(120)
password!: string;
@IsOptional()
@IsArray()
@ValidateNested({ each: true })
@Type(() => ImportDecisionDto)
decisions?: ImportDecisionDto[];
/** اگر true فقط پیش‌نمایش برگردد */
@IsOptional()
@Allow()
preview?: boolean;
}