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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user