import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"
import {
  IsArray,
  IsNotEmpty,
  IsOptional,
  IsString,
  IsInt,
} from "class-validator"
import { Type } from "class-transformer"

export class SendNotificationDto {
  @ApiProperty({
    description: "Array of user IDs to send notifications to",
    example: [1, 2, 3],
    type: [Number],
  })
  @IsArray()
  @IsInt({ each: true })
  @IsNotEmpty({ each: true })
  @Type(() => Number)
  user_ids: number[]

  @ApiProperty({
    description: "Title of the notification",
    example: "Important Update",
  })
  @IsString()
  @IsNotEmpty()
  title: string

  @ApiProperty({
    description: "Message content of the notification",
    example: "Your order has been shipped!",
  })
  @IsString()
  @IsNotEmpty()
  message: string

  @ApiPropertyOptional({
    description: "Additional data payload for the notification",
    example: { orderId: "XYZ123", type: "shipping" },
  })
  @IsOptional()
  data?: any
}
