43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
import { IsOptional, IsString, IsNumber, IsIn } from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
import { ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
|
export class SmsLogQueryDto {
|
|
@ApiPropertyOptional({ description: 'شماره صفحه', example: 1 })
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsNumber()
|
|
page?: number;
|
|
|
|
@ApiPropertyOptional({ description: 'تعداد آیتمها در صفحه', example: 15 })
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsNumber()
|
|
limit?: number;
|
|
|
|
@ApiPropertyOptional({ description: 'جستجو در گیرنده، پیام یا شناسه', example: '0912' })
|
|
@IsOptional()
|
|
@IsString()
|
|
search?: string;
|
|
|
|
@ApiPropertyOptional({ description: 'فیلتر نوع پیامک', example: 'OTP' })
|
|
@IsOptional()
|
|
@IsString()
|
|
type?: string;
|
|
|
|
@ApiPropertyOptional({ description: 'فیلتر وضعیت پیامک', example: 'SUCCESS' })
|
|
@IsOptional()
|
|
@IsString()
|
|
status?: string;
|
|
|
|
@ApiPropertyOptional({ description: 'مرتبسازی بر اساس فیلد', example: 'createdAt' })
|
|
@IsOptional()
|
|
@IsString()
|
|
sortBy?: string;
|
|
|
|
@ApiPropertyOptional({ description: 'ترتیب مرتبسازی', example: 'desc', enum: ['asc', 'desc'] })
|
|
@IsOptional()
|
|
@IsIn(['asc', 'desc'])
|
|
sortOrder?: 'asc' | 'desc';
|
|
}
|