import { IsString, IsUUID, IsEnum, IsOptional, IsObject, MaxLength } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { NotificationChannel } from '../../../domain/entities/notification.entity';

export class SendNotificationDto {
  @ApiProperty({ description: 'Target user UUID', example: '550e8400-e29b-41d4-a716-446655440000' })
  @IsUUID()
  userId: string;

  @ApiProperty({ description: 'Notification channel', enum: NotificationChannel, example: NotificationChannel.IN_APP })
  @IsEnum(NotificationChannel)
  channel: NotificationChannel;

  @ApiProperty({ description: 'Notification title', example: 'Trade Executed', maxLength: 200 })
  @IsString()
  @MaxLength(200)
  title: string;

  @ApiProperty({ description: 'Notification body', example: 'Your buy order was filled: 10 unit(s) at $25.50' })
  @IsString()
  body: string;

  @ApiPropertyOptional({ description: 'Additional payload data', example: { type: 'trade', couponId: 'abc-123' } })
  @IsOptional()
  @IsObject()
  data?: Record<string, any>;
}
