2026-11-17 21:24:15 +03:30
|
|
|
import { Type } from 'class-transformer';
|
|
|
|
|
import {
|
2026-11-18 15:28:08 +03:30
|
|
|
IsIn,
|
2026-11-18 13:22:38 +03:30
|
|
|
IsInt,
|
2026-11-17 21:24:15 +03:30
|
|
|
IsNumber,
|
|
|
|
|
IsObject,
|
|
|
|
|
IsOptional,
|
|
|
|
|
IsString,
|
2026-11-18 13:22:38 +03:30
|
|
|
Max,
|
2026-11-17 21:24:15 +03:30
|
|
|
MaxLength,
|
2026-11-18 13:22:38 +03:30
|
|
|
Min,
|
2026-11-17 21:24:15 +03:30
|
|
|
ValidateIf,
|
|
|
|
|
ValidateNested,
|
|
|
|
|
} from 'class-validator';
|
|
|
|
|
|
|
|
|
|
export class AccountBalanceRangeBody {
|
2026-11-18 15:28:08 +03:30
|
|
|
@IsIn(['all_debtors', 'range'])
|
|
|
|
|
mode!: 'all_debtors' | 'range';
|
2026-11-17 21:24:15 +03:30
|
|
|
|
2026-11-18 15:28:08 +03:30
|
|
|
@ValidateIf((o: AccountBalanceRangeBody) => o.mode === 'range')
|
2026-11-17 21:24:15 +03:30
|
|
|
@IsNumber()
|
2026-11-18 15:28:08 +03:30
|
|
|
min?: number;
|
|
|
|
|
|
|
|
|
|
@ValidateIf((o: AccountBalanceRangeBody) => o.mode === 'range')
|
|
|
|
|
@IsNumber()
|
|
|
|
|
max?: number;
|
2026-11-17 21:24:15 +03:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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>;
|
|
|
|
|
}
|
2026-11-18 13:22:38 +03:30
|
|
|
|
|
|
|
|
export class EvaluateAccountBalancesDto {
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@Type(() => Number)
|
|
|
|
|
@IsInt()
|
|
|
|
|
@Min(0)
|
|
|
|
|
offset?: number;
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@Type(() => Number)
|
|
|
|
|
@IsInt()
|
|
|
|
|
@Min(1)
|
|
|
|
|
@Max(2000)
|
|
|
|
|
limit?: number;
|
|
|
|
|
}
|