import { IsString, IsNumber, Min, Max } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class PricingRequestDto {
  @ApiProperty({ description: 'Coupon ID', example: 'coupon-456' })
  @IsString()
  couponId: string;

  @ApiProperty({ description: 'Coupon face value', example: 100 })
  @IsNumber()
  @Min(0)
  faceValue: number;

  @ApiProperty({ description: 'Days remaining to expiry', example: 90 })
  @IsNumber()
  @Min(0)
  daysToExpiry: number;

  @ApiProperty({ description: 'Total validity period in days', example: 365 })
  @IsNumber()
  @Min(0)
  totalDays: number;

  @ApiProperty({ description: 'Historical redemption rate (0-1)', example: 0.8 })
  @IsNumber()
  @Min(0)
  @Max(1)
  redemptionRate: number;

  @ApiProperty({ description: 'Liquidity premium discount (0-1)', example: 0.05 })
  @IsNumber()
  @Min(0)
  @Max(1)
  liquidityPremium: number;
}

export class PricingResponseDto {
  @ApiProperty({ description: 'Suggested trading price' })
  suggestedPrice: number;

  @ApiProperty({ description: 'Confidence level (0-1)' })
  confidence: number;

  @ApiProperty({ description: 'Pricing factor breakdown' })
  factors: Record<string, number>;
}
