import { IsString, IsOptional, IsNumber, IsIn } from 'class-validator';
import { Type } from 'class-transformer';

export class GetPublicImagesDto {
	@IsNumber()
	@IsOptional()
	@Type(() => Number)
	page?: number = 1;

	@IsNumber()
	@IsOptional()
	@Type(() => Number)
	limit?: number = 20;

	@IsString()
	@IsOptional()
	@IsIn(['recent', 'popular', 'trending'])
	sortBy?: 'recent' | 'popular' | 'trending' = 'recent';
}

export class SearchPublicImagesDto {
	@IsString()
	searchTerm: string;

	@IsNumber()
	@IsOptional()
	@Type(() => Number)
	page?: number = 1;

	@IsNumber()
	@IsOptional()
	@Type(() => Number)
	limit?: number = 20;
}
