// Import types from ManagingApi
import type {Backtest, RiskManagement, TradingBotConfig} from '../generated/ManagingApi'

// Import the existing IBacktestsFormInput from the correct file
import type {IBacktestsFormInput} from './type.tsx'

export interface IRiskManagementInput {
  adverseProbabilityThreshold: number
  favorableProbabilityThreshold: number
  riskAversion: number
  kellyMinimumThreshold: number
  kellyMaximumCap: number
  maxLiquidationProbability: number
  signalValidationTimeHorizonHours: number
  positionMonitoringTimeHorizonHours: number
  positionWarningThreshold: number
  positionAutoCloseThreshold: number
  kellyFractionalMultiplier: number
  riskTolerance: 'Conservative' | 'Moderate' | 'Aggressive'
  useExpectedUtility: boolean
  useKellyCriterion: boolean
}

export interface IUnifiedTradingConfigInput extends IBacktestsFormInput {
  // Bot-specific fields
  name?: string
  isForWatchingOnly?: boolean
  flipPosition?: boolean
  
  // Risk Management fields
  riskManagement?: RiskManagement
  useCustomRiskManagement?: boolean
}

export interface UnifiedTradingModalProps {
  showModal: boolean
  closeModal: () => void
  mode: 'backtest' | 'createBot' | 'updateBot'
  
  // For backtests
  setBacktests?: React.Dispatch<React.SetStateAction<Backtest[]>>
  onBacktestComplete?: () => void // Callback when backtest is completed
  
  // For bot creation/update  
  backtest?: Backtest // Backtest object when creating from backtest
  existingBot?: {
    identifier: string
    config: TradingBotConfig // TradingBotConfig from API
  }
} 