import { IsOptional, IsUUID, IsInt, IsEnum, Min, Max } from 'class-validator';
import { Type } from 'class-transformer';
import { ApiPropertyOptional } from '@nestjs/swagger';
import { FunnelStage } from '@prisma/client';

export class FindFunnelDto {
  @ApiPropertyOptional({
    description: 'Cursor for pagination (UUID of last item)',
    example: '550e8400-e29b-41d4-a716-446655440000',
  })
  @IsUUID()
  @IsOptional()
  cursor?: string;

  @ApiPropertyOptional({
    description: 'Number of items to return (1-100)',
    default: 20,
    minimum: 1,
    maximum: 100,
  })
  @Type(() => Number)
  @IsInt()
  @Min(1)
  @Max(100)
  @IsOptional()
  limit?: number = 20;

  @ApiPropertyOptional({
    description: 'Filter by funnel stage',
    enum: FunnelStage,
    example: FunnelStage.NEW,
  })
  @IsEnum(FunnelStage)
  @IsOptional()
  stage?: FunnelStage;

  @ApiPropertyOptional({
    description: 'Filter by trainer UUID',
    example: '550e8400-e29b-41d4-a716-446655440001',
  })
  @IsUUID()
  @IsOptional()
  trainerId?: string;
}
