2026-08-17 20:14:17 +03:30
|
|
|
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';
|
|
|
|
|
}
|
2026-08-17 15:02:22 +03:30
|
|
|
|
|
|
|
|
export class ImportProgramSettingsDto {
|
|
|
|
|
@IsString()
|
|
|
|
|
@MinLength(3)
|
|
|
|
|
@MaxLength(32)
|
|
|
|
|
mobile!: string;
|
|
|
|
|
|
|
|
|
|
@IsString()
|
|
|
|
|
@MinLength(1)
|
|
|
|
|
@MaxLength(120)
|
|
|
|
|
password!: string;
|
2026-08-17 20:14:17 +03:30
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsArray()
|
|
|
|
|
@ValidateNested({ each: true })
|
|
|
|
|
@Type(() => ImportDecisionDto)
|
|
|
|
|
decisions?: ImportDecisionDto[];
|
|
|
|
|
|
|
|
|
|
/** اگر true فقط پیشنمایش برگردد */
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@Allow()
|
|
|
|
|
preview?: boolean;
|
2026-08-17 15:02:22 +03:30
|
|
|
}
|