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

export class UpdateIntegrationConfigDto {
  @ApiPropertyOptional({ description: '1C API URL', example: 'https://1c.example.com/api' })
  @IsUrl()
  @IsOptional()
  apiUrl?: string;

  @ApiPropertyOptional({ description: '1C API key' })
  @IsString()
  @IsOptional()
  apiKey?: string;

  @ApiPropertyOptional({ description: 'Whether sync is enabled' })
  @IsBoolean()
  @IsOptional()
  syncEnabled?: boolean;

  @ApiPropertyOptional({
    description: 'Additional settings (JSON)',
    example: { syncInterval: 3600, entities: ['clients', 'memberships'] },
  })
  @IsOptional()
  settings?: Record<string, any>;
}
