import { CategoryFilter } from './category.filter'; import { ApiPropertyOptional } from '@nestjs/swagger'; import { Transform } from 'class-transformer'; import { IsInt, IsOptional, Min, ValidateNested } from 'class-validator'; export class FindManyCategoryDto { @ApiPropertyOptional({ type: CategoryFilter }) @IsOptional() @ValidateNested() @Transform(({ value }) => value) where?: InstanceType; @ApiPropertyOptional({ description: 'Number of records to take', default: 10 }) @IsOptional() @IsInt() @Min(1) @Transform(({ value }) => value !== undefined ? Number(value) : 10) take = 10; @ApiPropertyOptional({ description: 'Number of records to skip', default: 0 }) @IsOptional() @IsInt() @Min(0) @Transform(({ value }) => value !== undefined ? Number(value) : 0) skip = 0; @ApiPropertyOptional({ description: 'Record to start from' }) @IsOptional() cursor?: Record; @ApiPropertyOptional({ description: 'Ordering of results' }) @IsOptional() orderBy?: Record; }