30 lines
750 B
TypeScript
30 lines
750 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { IsOptional, IsString, IsNumber, Min } from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
|
|
export class FindRolesDto {
|
|
@ApiProperty({ description: 'Search by role name', required: false })
|
|
@IsOptional()
|
|
@IsString()
|
|
name?: string;
|
|
|
|
@ApiProperty({ description: 'Restaurant id filter', required: false })
|
|
@IsOptional()
|
|
@IsString()
|
|
restId?: string;
|
|
|
|
@ApiProperty({ description: 'Page number', required: false, default: 1 })
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsNumber()
|
|
@Min(1)
|
|
page?: number;
|
|
|
|
@ApiProperty({ description: 'Items per page', required: false, default: 20 })
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsNumber()
|
|
@Min(1)
|
|
limit?: number;
|
|
}
|