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

export class CreateBotWebhookDto {
  @ApiProperty()
  @IsUrl()
  url: string;

  @ApiProperty({
    description: 'Events to subscribe to',
    example: ['subscriber.created', 'referral.completed'],
  })
  @IsArray()
  @IsString({ each: true })
  events: string[];
}

export class UpdateBotWebhookDto {
  @ApiPropertyOptional()
  @IsOptional()
  @IsUrl()
  url?: string;

  @ApiPropertyOptional()
  @IsOptional()
  @IsArray()
  @IsString({ each: true })
  events?: string[];

  @ApiPropertyOptional()
  @IsOptional()
  @IsBoolean()
  isActive?: boolean;
}
