/**
 * Test Logs Fixtures
 * 
 * Sample log data for E2E testing
 */

export interface TestLog {
  timestamp: string;
  level: 'INFO' | 'WARN' | 'ERROR' | 'DEBUG';
  message: string;
  service: string;
  metadata?: Record<string, unknown>;
}

export const testLogs: TestLog[] = [
  {
    timestamp: new Date().toISOString(),
    level: 'INFO',
    message: 'Application started successfully',
    service: 'lambda',
    metadata: {
      functionName: 'test-function',
      memorySize: 512,
      duration: 1250,
    },
  },
  {
    timestamp: new Date(Date.now() - 1000).toISOString(),
    level: 'INFO',
    message: 'Processing SQS message batch',
    service: 'sqs',
    metadata: {
      queueName: 'test-queue',
      batchSize: 10,
      messageCount: 5,
    },
  },
  {
    timestamp: new Date(Date.now() - 2000).toISOString(),
    level: 'INFO',
    message: 'Bedrock LLM invocation completed',
    service: 'bedrock',
    metadata: {
      modelId: 'anthropic.claude-3-sonnet-20240229-v1:0',
      inputTokens: 150,
      outputTokens: 250,
      duration: 2345,
    },
  },
  {
    timestamp: new Date(Date.now() - 3000).toISOString(),
    level: 'WARN',
    message: 'Potential PII detected in request',
    service: 'lambda',
    metadata: {
      piiType: 'EMAIL',
      confidence: 0.95,
      masked: true,
    },
  },
  {
    timestamp: new Date(Date.now() - 4000).toISOString(),
    level: 'ERROR',
    message: 'Failed to process message after 3 retries',
    service: 'sqs',
    metadata: {
      errorCode: 'ProcessingFailed',
      retryCount: 3,
      deadLetterQueue: true,
    },
  },
];

export const logsWithPII: TestLog[] = [
  {
    timestamp: new Date().toISOString(),
    level: 'INFO',
    message: 'User login: john.doe@example.com',
    service: 'lambda',
    metadata: {
      userId: 'user-12345',
      email: 'john.doe@example.com',
    },
  },
  {
    timestamp: new Date(Date.now() - 1000).toISOString(),
    level: 'INFO',
    message: 'Payment processed for card ending 4532',
    service: 'lambda',
    metadata: {
      cardLastFour: '4532',
      amount: 99.99,
      currency: 'USD',
    },
  },
  {
    timestamp: new Date(Date.now() - 2000).toISOString(),
    level: 'INFO',
    message: 'Phone verification: +1-555-123-4567',
    service: 'lambda',
    metadata: {
      phone: '+1-555-123-4567',
      verified: true,
    },
  },
];

export const highVolumeLogs: TestLog[] = Array.from({ length: 100 }, (_, i) => ({
  timestamp: new Date(Date.now() - i * 100).toISOString(),
  level: i % 10 === 0 ? 'ERROR' : i % 5 === 0 ? 'WARN' : 'INFO',
  message: `Log entry ${i + 1}: ${i % 3 === 0 ? 'SQS message processed' : i % 3 === 1 ? 'Lambda invoked' : 'Bedrock API call'}`,
  service: i % 3 === 0 ? 'sqs' : i % 3 === 1 ? 'lambda' : 'bedrock',
  metadata: {
    sequenceNumber: i + 1,
    batchId: `batch-${Math.floor(i / 10)}`,
  },
}));
