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

export class UpdateConfigDto {
  @ApiProperty({
    description: 'Enable Discord notifications',
    example: true,
    required: false,
  })
  @IsBoolean()
  @IsOptional()
  discord_enabled?: boolean;

  @ApiProperty({
    description: 'Discord webhook URL',
    example: 'https://discord.com/api/webhooks/...',
    required: false,
  })
  @IsUrl()
  @IsString()
  @IsOptional()
  discord_webhook_url?: string;

  @ApiProperty({
    description: 'Enable Pushbullet notifications',
    example: false,
    required: false,
  })
  @IsBoolean()
  @IsOptional()
  pushbullet_enabled?: boolean;

  @ApiProperty({
    description: 'Pushbullet API key',
    example: 'o.xxxxxxxxxxxxx',
    required: false,
  })
  @IsString()
  @IsOptional()
  pushbullet_api_key?: string;

  @ApiProperty({
    description: 'Enable email alert notifications',
    example: true,
    required: false,
  })
  @IsBoolean()
  @IsOptional()
  email_alerts_enabled?: boolean;

  @ApiProperty({
    description: 'Notify on wipe start',
    example: true,
    required: false,
  })
  @IsBoolean()
  @IsOptional()
  notify_wipe_start?: boolean;

  @ApiProperty({
    description: 'Notify on wipe complete',
    example: true,
    required: false,
  })
  @IsBoolean()
  @IsOptional()
  notify_wipe_complete?: boolean;

  @ApiProperty({
    description: 'Notify on wipe failure',
    example: true,
    required: false,
  })
  @IsBoolean()
  @IsOptional()
  notify_wipe_failed?: boolean;

  @ApiProperty({
    description: 'Notify on server crash',
    example: true,
    required: false,
  })
  @IsBoolean()
  @IsOptional()
  notify_server_crash?: boolean;

  @ApiProperty({
    description: 'Notify when server goes offline',
    example: true,
    required: false,
  })
  @IsBoolean()
  @IsOptional()
  notify_server_offline?: boolean;

  @ApiProperty({
    description: 'Notify on store purchase',
    example: true,
    required: false,
  })
  @IsBoolean()
  @IsOptional()
  notify_store_purchase?: boolean;

  @ApiProperty({
    description: 'Notify on player report',
    example: false,
    required: false,
  })
  @IsBoolean()
  @IsOptional()
  notify_player_report?: boolean;
}
