Files
CRM_Montzar/apps/api/src/account-balances/dto.ts
T

36 lines
643 B
TypeScript

import { Type } from 'class-transformer';
import {
IsNumber,
IsObject,
IsOptional,
IsString,
MaxLength,
ValidateIf,
ValidateNested,
} from 'class-validator';
export class AccountBalanceRangeBody {
@IsNumber()
min!: number;
@IsNumber()
max!: number;
}
export class UpdateAccountBalanceSettingsDto {
@IsOptional()
@IsString()
@MaxLength(80)
firstStageName?: string;
@IsOptional()
@ValidateIf((_, v) => v !== null)
@ValidateNested()
@Type(() => AccountBalanceRangeBody)
rial?: AccountBalanceRangeBody | null;
@IsOptional()
@IsObject()
weights?: Record<string, AccountBalanceRangeBody | null>;
}