import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { DiscoveredRouteDto } from './create-breach-check-baseline.dto';
import { BreachCheckWebsiteResponseDto } from './breach-check-website-response.dto';

export class BreachCheckWebsiteBaselineResponseDto {
  @ApiProperty({
    description: 'Baseline ID',
    example: 1,
  })
  id: number;

  @ApiProperty({
    description: 'Website ID',
    example: 1,
  })
  websiteId: number;

  @ApiPropertyOptional({
    description: 'Primary MD5 hash of main content',
    example: 'a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6',
  })
  mainContentHash?: string;

  @ApiPropertyOptional({
    description: 'JSON snapshot of content signature',
  })
  contentSnapshot?: string;

  @ApiPropertyOptional({
    description: 'Hash of page title',
  })
  titleHash?: string;

  @ApiPropertyOptional({
    description: 'Hash of page structure',
  })
  structureHash?: string;

  @ApiPropertyOptional({
    description: 'Hash of main body text content',
  })
  bodyTextHash?: string;

  @ApiPropertyOptional({
    description: 'Hash of meta description',
  })
  metaDescHash?: string;

  @ApiPropertyOptional({
    description: 'Last content update timestamp',
  })
  lastContentUpdate?: Date;

  @ApiPropertyOptional({
    description: 'Expected HTTP status code',
    example: 200,
  })
  httpStatusBaseline?: number;

  @ApiPropertyOptional({
    description: 'Array of discovered routes',
    type: [DiscoveredRouteDto],
  })
  discoveredRoutes?: DiscoveredRouteDto[];

  @ApiPropertyOptional({
    description: 'Hash of all routes structure',
  })
  routesHash?: string;

  @ApiPropertyOptional({
    description: 'Last crawl update timestamp',
  })
  lastCrawlUpdate?: Date;

  @ApiProperty({
    description: 'Whether AI analysis is enabled',
    example: true,
  })
  aiAnalysisEnabled: boolean;

  @ApiProperty({
    description: 'Whether crawling is enabled',
    example: true,
  })
  crawlingEnabled: boolean;

  @ApiProperty({
    description: 'Maximum crawl depth',
    example: 2,
  })
  maxCrawlDepth: number;

  @ApiProperty({
    description: 'Maximum crawl URLs',
    example: 20,
  })
  maxCrawlUrls: number;

  @ApiPropertyOptional({
    description: 'Last updated timestamp',
  })
  lastUpdated?: Date;

  @ApiProperty({
    description: 'Baseline version',
    example: 1,
  })
  baselineVersion: number;

  @ApiProperty({
    description: 'Sensitivity level',
    example: 50,
  })
  sensitivityLevel: number;

  @ApiProperty({
    description: 'Creation timestamp',
    example: '2024-01-01T00:00:00.000Z',
  })
  createdAt: Date;

  @ApiProperty({
    description: 'Last update timestamp',
    example: '2024-01-01T00:00:00.000Z',
  })
  updatedAt: Date;

  @ApiPropertyOptional({
    description: 'Associated website',
    type: () => BreachCheckWebsiteResponseDto,
  })
  website?: BreachCheckWebsiteResponseDto;
}
