import { IsString, IsOptional, IsObject } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export class ChatRequestDto {
  @ApiProperty({ description: 'User ID', example: 'user-123' })
  @IsString()
  userId: string;

  @ApiProperty({ description: 'Chat message content', example: 'How do I redeem a coupon?' })
  @IsString()
  message: string;

  @ApiPropertyOptional({ description: 'Existing session ID to continue conversation' })
  @IsOptional()
  @IsString()
  sessionId?: string;

  @ApiPropertyOptional({ description: 'Additional context for the AI agent' })
  @IsOptional()
  @IsObject()
  context?: Record<string, any>;
}

export class ChatResponseDto {
  @ApiProperty({ description: 'AI reply text' })
  reply: string;

  @ApiProperty({ description: 'Session ID for conversation continuity' })
  sessionId: string;

  @ApiPropertyOptional({ description: 'Suggested follow-up actions', type: [String] })
  suggestions?: string[];
}
