20 lines
755 B
TypeScript
Executable File
20 lines
755 B
TypeScript
Executable File
import { ApiPropertyOptional } from "@nestjs/swagger";
|
|
import { Type } from "class-transformer";
|
|
import { IsIn, IsOptional, IsString } from "class-validator";
|
|
|
|
import { PaginationDto } from "../../../common/DTO/pagination.dto";
|
|
import { CommonMessage, FinancialMessage } from "../../../common/enums/message.enum";
|
|
|
|
export class SearchCustomersDto extends PaginationDto {
|
|
@IsOptional()
|
|
@IsString({ message: FinancialMessage.SEARCH_QUERY_MUST_BE_A_STRING })
|
|
@ApiPropertyOptional({ description: "search query", example: "search query" })
|
|
q?: string;
|
|
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsIn([1, 0], { message: CommonMessage.PAGINATE_SHOULD_BE_1_0 })
|
|
@ApiPropertyOptional({ description: "paginate status", example: 1 })
|
|
paginate?: number;
|
|
}
|