dvbooking/server/src/product/dto/query-product.dto.ts
2025-11-19 09:52:15 +01:00

33 lines
666 B
TypeScript

import { IsOptional, IsString, IsNumber, IsIn, IsBoolean } from 'class-validator';
import { Type } from 'class-transformer';
export class QueryProductDto {
@IsOptional()
@Type(() => Number)
@IsNumber()
page?: number;
@IsOptional()
@Type(() => Number)
@IsNumber()
limit?: number;
@IsOptional()
@IsString()
sortBy?: string; // Should be a property of the Product entity
@IsOptional()
@IsIn(['ASC', 'DESC'])
order?: 'ASC' | 'DESC';
// --- Add other filterable properties below ---
// @IsOptional()
// @IsString()
// name?: string;
// @IsOptional()
// @Type(() => Boolean)
// @IsBoolean()
// is_available?: boolean;
}