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

54 lines
880 B
TypeScript
Raw Normal View History

import { Type } from 'class-transformer';
import {
IsInt,
IsNumber,
IsObject,
IsOptional,
IsString,
Max,
MaxLength,
Min,
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>;
}
export class EvaluateAccountBalancesDto {
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(0)
offset?: number;
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(1)
@Max(2000)
limit?: number;
}