56 lines
1.5 KiB
TypeScript
56 lines
1.5 KiB
TypeScript
import { IsBoolean, IsNumber, IsOptional, IsString } from 'class-validator';
|
|
import { ApiPropertyOptional } from '@nestjs/swagger';
|
|
import { Type } from 'class-transformer';
|
|
|
|
export class FindReviewsDto {
|
|
@IsOptional()
|
|
@IsNumber()
|
|
@Type(() => Number)
|
|
@ApiPropertyOptional({ description: 'Page number', example: 1 })
|
|
page?: number;
|
|
|
|
@IsOptional()
|
|
@IsNumber()
|
|
@Type(() => Number)
|
|
@ApiPropertyOptional({ description: 'Items per page', example: 10 })
|
|
limit?: number;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@ApiPropertyOptional({ description: 'Food ID to filter comments' })
|
|
foodId?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@ApiPropertyOptional({ description: 'Restaurant ID to filter comments' })
|
|
restId?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@ApiPropertyOptional({ description: 'User ID to filter comments' })
|
|
userId?: string;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
@ApiPropertyOptional({ description: 'Filter by approval status' })
|
|
@Type(() => Boolean)
|
|
isApproved?: boolean;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@ApiPropertyOptional({ description: 'Order by field', example: 'createdAt' })
|
|
orderBy?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@ApiPropertyOptional({ description: 'Order direction', enum: ['asc', 'desc'], example: 'desc' })
|
|
order?: 'asc' | 'desc';
|
|
}
|
|
|
|
export class FindRestuarantReviewsDto extends FindReviewsDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
@ApiPropertyOptional({ description: 'Restaurant slug to filter comments' })
|
|
restuarantSlug?: string;
|
|
}
|