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>
36 lines
747 B
TypeScript
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;
|
|
}
|