21 lines
558 B
TypeScript
21 lines
558 B
TypeScript
import { IsOptional, IsInt, Min, Max } from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
import { ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
|
export class PaginationQueryDto {
|
|
@ApiPropertyOptional({ description: 'Page number (1-based)', default: 1, minimum: 1 })
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(1)
|
|
page?: number = 1;
|
|
|
|
@ApiPropertyOptional({ description: 'Items per page', default: 20, minimum: 1, maximum: 100 })
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(1)
|
|
@Max(100)
|
|
limit?: number = 20;
|
|
}
|