/**
 * Veza Fixtures - Complete Fixture System
 * 
 * Main entry point for the Veza Platform fixtures system
 */

// Core exports
export * from './core'

// Service fixtures
export { WebFixtures } from './services/web'
export { ChatServerFixtures } from './services/chat-server'
export { StreamServerFixtures } from './services/stream-server'

// Scenarios
export { NewUserOnboardingScenario, type OnboardingScenarioContext } from './scenarios/user-journey/new-user-onboarding'
export { HighLoadScenario, type HighLoadScenarioContext } from './scenarios/performance/high-load'
export { CrossServiceCommunicationScenario, type CrossServiceScenarioContext } from './scenarios/integration/cross-service-communication'

// Version
export const VERSION = '1.0.0'

/**
 * Quick start function for common use cases
 */
export async function quickStart(options?: {
  environment?: string
  services?: ('web' | 'chat' | 'stream')[]
  scenario?: 'onboarding' | 'high-load' | 'integration'
}) {
  const { VezaFixtures } = await import('./core')
  const { WebFixtures } = await import('./services/web')
  const { ChatServerFixtures } = await import('./services/chat-server')
  const { StreamServerFixtures } = await import('./services/stream-server')
  
  const environment = options?.environment || 'development'
  const services = options?.services || ['web', 'chat', 'stream']
  
  console.log('🚀 Veza Fixtures Quick Start...')
  
  // Initialize core system
  await VezaFixtures.initialize(environment)
  
  // Generate dataset
  const dataset = VezaFixtures.generateCompleteDataset()
  
  // Initialize services
  if (services.includes('web')) {
    await WebFixtures.initialize()
  }
  
  if (services.includes('chat')) {
    await ChatServerFixtures.initialize()
    await ChatServerFixtures.seedDatabase()
    await ChatServerFixtures.seedRedis()
  }
  
  if (services.includes('stream')) {
    await StreamServerFixtures.initialize()
    await StreamServerFixtures.seedStreamingData()
  }
  
  // Run scenario if specified
  if (options?.scenario) {
    console.log(`🎬 Running scenario: ${options.scenario}`)
    
    switch (options.scenario) {
      case 'onboarding':
        const { NewUserOnboardingScenario } = await import('./scenarios/user-journey/new-user-onboarding')
        await NewUserOnboardingScenario.setup()
        break
      case 'high-load':
        const { HighLoadScenario } = await import('./scenarios/performance/high-load')
        await HighLoadScenario.setup()
        break
      case 'integration':
        const { CrossServiceCommunicationScenario } = await import('./scenarios/integration/cross-service-communication')
        await CrossServiceCommunicationScenario.setup()
        break
    }
  }
  
  console.log('✅ Quick start completed successfully!')
  
  return {
    dataset,
    stats: VezaFixtures.getStatistics(),
    validation: VezaFixtures.validateRelations()
  }
}