Files
api/src/program-settings/dto/import-program-settings.dto.ts
T
mohmdsdgandCursor d57ce0a3cb 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>
2026-08-17 20:14:17 +03:30

36 lines
747 B
TypeScript

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()
@MinLength(3)
@MaxLength(32)
mobile!: string;
@IsString()
@MinLength(1)
@MaxLength(120)
password!: string;
@IsOptional()
@IsArray()
@ValidateNested({ each: true })
@Type(() => ImportDecisionDto)
decisions?: ImportDecisionDto[];
/** اگر true فقط پیش‌نمایش برگردد */
@IsOptional()
@Allow()
preview?: boolean;
}