44 lines
950 B
TypeScript
44 lines
950 B
TypeScript
import { ApiPropertyOptional } from '@nestjs/swagger';
|
|
import { Transform } from 'class-transformer';
|
|
import { IsDateString, IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
|
|
|
|
export class BrokerOperationQueryDto {
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsDateString()
|
|
from?: string;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsDateString()
|
|
to?: string;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsString()
|
|
cursor?: string;
|
|
|
|
@ApiPropertyOptional({ minimum: 1, maximum: 1000, default: 100 })
|
|
@IsOptional()
|
|
@Transform(({ value }) => (value === undefined ? undefined : Number(value)))
|
|
@IsInt()
|
|
@Min(1)
|
|
@Max(1000)
|
|
limit?: number;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsString()
|
|
instrumentId?: string;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsString()
|
|
operationTypes?: string;
|
|
|
|
@ApiPropertyOptional({ default: 'OPERATION_STATE_EXECUTED' })
|
|
@IsOptional()
|
|
@IsString()
|
|
state?: string;
|
|
}
|