import {
  IsArray,
  IsString,
  IsOptional,
  IsNotEmpty,
  IsNumber,
  IsEnum,
  ArrayMaxSize,
  Min,
  Max,
} from "class-validator";
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";

export class GeneratePredictionDto {
  @ApiProperty({ description: "Match ID to generate prediction for" })
  @IsString()
  @IsNotEmpty()
  matchId: string;
}

export enum CouponStrategy {
  SAFE = "SAFE",
  BALANCED = "BALANCED",
  AGGRESSIVE = "AGGRESSIVE",
  VALUE = "VALUE",
  MIRACLE = "MIRACLE",
}

export class SmartCouponRequestDto {
  @ApiProperty({
    description: "List of match IDs for coupon",
    example: ["match-1", "match-2"],
  })
  @IsArray()
  @IsString({ each: true })
  @ArrayMaxSize(50)
  matchIds: string[];

  @ApiPropertyOptional({
    enum: CouponStrategy,
    default: CouponStrategy.BALANCED,
  })
  @IsOptional()
  @IsEnum(CouponStrategy)
  strategy?: CouponStrategy;

  @ApiPropertyOptional({ description: "Maximum matches in coupon", example: 5 })
  @IsOptional()
  @IsNumber()
  @Min(1)
  @Max(20)
  maxMatches?: number;

  @ApiPropertyOptional({
    description: "Minimum confidence threshold (0-100)",
    example: 60,
  })
  @IsOptional()
  @IsNumber()
  @Min(0)
  @Max(100)
  minConfidence?: number;
}
