import {
  IsString,
  IsEnum,
  IsOptional,
  IsBoolean,
  IsObject,
  IsArray,
  MaxLength,
} from 'class-validator';
import { FeedbackType, FeedbackSentiment } from '../feedback.entity';

export class CreateFeedbackDto {
  @IsEnum(FeedbackType)
  type: FeedbackType;

  @IsString()
  @MaxLength(5000)
  message: string;

  @IsString()
  @IsOptional()
  @MaxLength(200)
  title?: string;

  @IsString()
  @IsOptional()
  category?: string;

  @IsString()
  @IsOptional()
  page?: string;

  @IsString()
  @IsOptional()
  platform?: string;

  @IsString()
  @IsOptional()
  appVersion?: string;

  @IsString()
  @IsOptional()
  browserInfo?: string;

  @IsString()
  @IsOptional()
  deviceInfo?: string;

  @IsObject()
  @IsOptional()
  metadata?: Record<string, any>;

  @IsArray()
  @IsOptional()
  tags?: string[];

  @IsString()
  @IsOptional()
  userEmail?: string;

  @IsBoolean()
  @IsOptional()
  contactAllowed?: boolean;

  @IsEnum(FeedbackSentiment)
  @IsOptional()
  sentiment?: FeedbackSentiment;
}
