# ============================================================================
# FRONTEND_INVENTORY.yml - Trading Platform Trading Platform
# ============================================================================
# Proposito: Inventario consolidado de todos los componentes del frontend
# Ultima actualizacion: 2025-12-05
# Version: 1.0.0
# ============================================================================

version: "1.2.0"
project: "Trading Platform"
framework: "React 18 + TypeScript + Vite"
styling: "TailwindCSS + shadcn/ui"
state_management: "Zustand"
last_updated: "2026-01-28"

# ============================================================================
# RESUMEN EJECUTIVO
# ============================================================================
summary:
  total_features: 9   # auth, dashboard, education, trading, investment, settings, notifications, payments, ml
  total_pages: 19     # +1 AgentsPage
  total_components: 106  # +16 nuevos (Sprint 1-2)
  total_hooks: 4       # +1 useMlOverlayData
  total_stores: 3     # +1 agentsStore
  status: "En desarrollo (OQI-003 al 80%)"

# ============================================================================
# ESTRUCTURA DE DIRECTORIOS
# ============================================================================
structure:
  root: "apps/frontend/src"
  directories:
    - path: components/
      purpose: "Componentes compartidos (layout)"

    - path: modules/
      purpose: "Features organizados por dominio"

    - path: hooks/
      purpose: "Custom hooks compartidos"
      status: "Pendiente"

    - path: stores/
      purpose: "Zustand stores"
      status: "Pendiente"

    - path: types/
      purpose: "Tipos TypeScript compartidos"
      status: "Pendiente"

    - path: lib/
      purpose: "Utilidades y helpers"
      status: "Pendiente"

# ============================================================================
# FEATURES (MODULOS)
# ============================================================================
features:
  # --------------------------------------------------------------------------
  # AUTH - Autenticacion
  # --------------------------------------------------------------------------
  - name: auth
    path: modules/auth/
    epic: OQI-001
    status: implemented
    description: "Login, registro, OAuth, 2FA"

    pages:
      - name: Login.tsx
        route: /login
        description: "Pagina de login"
        rf: RF-AUTH-002

      - name: Register.tsx
        route: /register
        description: "Pagina de registro"
        rf: RF-AUTH-002

      - name: ForgotPassword.tsx
        route: /forgot-password
        description: "Solicitar reset de password"
        rf: RF-AUTH-002

      - name: ResetPassword.tsx
        route: /reset-password
        description: "Completar reset de password"
        rf: RF-AUTH-002

      - name: VerifyEmail.tsx
        route: /verify-email
        description: "Verificacion de email"
        rf: RF-AUTH-002

      - name: AuthCallback.tsx
        route: /auth/callback
        description: "Callback de OAuth"
        rf: RF-AUTH-001

    components:
      - name: SocialLoginButtons.tsx
        purpose: "Botones de login social (Google, Facebook, X, Apple, GitHub)"
        rf: RF-AUTH-001

      - name: PhoneLoginForm.tsx
        purpose: "Formulario de login por telefono"
        rf: RF-AUTH-002

  # --------------------------------------------------------------------------
  # DASHBOARD - Panel principal
  # --------------------------------------------------------------------------
  - name: dashboard
    path: modules/dashboard/
    epic: OQI-001
    status: structure_only
    description: "Panel principal del usuario"

    pages:
      - name: Dashboard.tsx
        route: /dashboard
        description: "Dashboard principal"

    components_planned:
      - name: PortfolioSummary.tsx
        purpose: "Resumen de portfolio"

      - name: RecentActivity.tsx
        purpose: "Actividad reciente"

      - name: QuickActions.tsx
        purpose: "Acciones rapidas"

  # --------------------------------------------------------------------------
  # EDUCATION - Cursos
  # --------------------------------------------------------------------------
  - name: education
    path: modules/education/
    epic: OQI-002
    status: structure_only
    description: "Catalogo y detalle de cursos"

    pages:
      - name: Courses.tsx
        route: /courses
        description: "Catalogo de cursos"
        rf: RF-EDU-001

      - name: CourseDetail.tsx
        route: /courses/:slug
        description: "Detalle de curso"
        rf: RF-EDU-002

    pages_planned:
      - name: LessonViewer.tsx
        route: /courses/:slug/lessons/:lessonId
        description: "Visor de leccion"

      - name: QuizPage.tsx
        route: /courses/:slug/quizzes/:quizId
        description: "Pagina de quiz"

      - name: MyLearning.tsx
        route: /my-learning
        description: "Mis cursos inscritos"

    components_planned:
      - name: CourseCard.tsx
        purpose: "Tarjeta de curso"

      - name: LessonList.tsx
        purpose: "Lista de lecciones"

      - name: VideoPlayer.tsx
        purpose: "Reproductor de video"

      - name: QuizForm.tsx
        purpose: "Formulario de quiz"

      - name: ProgressBar.tsx
        purpose: "Barra de progreso"

  # --------------------------------------------------------------------------
  # TRADING - Trading y charts
  # --------------------------------------------------------------------------
  - name: trading
    path: modules/trading/
    epic: OQI-003
    status: structure_only
    description: "Charts, watchlists, paper trading"

    pages:
      - name: Trading.tsx
        route: /trading
        description: "Pagina principal de trading"
        rf: RF-TRD-001

    pages_planned:
      - name: PaperTrading.tsx
        route: /trading/paper
        description: "Paper trading"

      - name: Signals.tsx
        route: /trading/signals
        description: "Senales ML"

    components:
      # Core Trading Components
      - name: TradingChart.tsx
        purpose: "Chart con Lightweight Charts"
        rf: RF-TRD-003

      - name: CandlestickChart.tsx
        purpose: "Chart de velas basico"

      - name: CandlestickChartWithML.tsx
        purpose: "Chart de velas con overlay ML"
        rf: RF-TRD-003

      - name: ChartToolbar.tsx
        purpose: "Toolbar de herramientas del chart"

      - name: OrderForm.tsx
        purpose: "Formulario de ordenes"

      - name: PositionsList.tsx
        purpose: "Lista de posiciones abiertas"

      - name: TradesHistory.tsx
        purpose: "Historial de trades"

      # Watchlist Components
      - name: WatchlistSidebar.tsx
        purpose: "Sidebar de watchlist"

      - name: WatchlistItem.tsx
        purpose: "Item individual de watchlist"

      - name: AddSymbolModal.tsx
        purpose: "Modal para agregar simbolo"

      # Account & Stats
      - name: AccountSummary.tsx
        purpose: "Resumen de cuenta"

      - name: TradingStatsPanel.tsx
        purpose: "Panel de estadisticas de trading"

      # Panel Components
      - name: MLSignalsPanel.tsx
        purpose: "Panel de senales ML"
        rf: RF-TRD-003

      - name: AlertsPanel.tsx
        purpose: "Panel de alertas de precio"

      - name: OrderBookPanel.tsx
        purpose: "Panel de order book"

      - name: PaperTradingPanel.tsx
        purpose: "Panel de paper trading"

      # Utility
      - name: ExportButton.tsx
        purpose: "Boton para exportar datos"

      # MT4 Gateway Components (OQI-009)
      - name: MT4ConnectionStatus.tsx
        purpose: "Indicador de conexion MT4 con info de cuenta"
        epic: OQI-009
        rf: RF-MT4-001
        created: "2026-01-25"

      - name: LivePositionCard.tsx
        purpose: "Tarjeta de posicion en vivo con P&L y acciones"
        epic: OQI-009
        rf: RF-MT4-002
        created: "2026-01-25"

      - name: RiskMonitor.tsx
        purpose: "Dashboard de gestion de riesgo con metricas"
        epic: OQI-009
        rf: RF-MT4-003
        created: "2026-01-25"

      - name: index.ts
        purpose: "Exports de componentes de trading"

      # Chart Analysis Components (OQI-003)
      - name: IndicatorConfigPanel.tsx
        purpose: "Configuracion avanzada de indicadores tecnicos"
        epic: OQI-003
        rf: RF-TRD-006
        created: "2026-01-25"

      - name: ChartDrawingToolsPanel.tsx
        purpose: "Herramientas de dibujo para analisis tecnico"
        epic: OQI-003
        rf: RF-TRD-007
        created: "2026-01-25"

      - name: SymbolInfoPanel.tsx
        purpose: "Panel de informacion completa del simbolo"
        epic: OQI-003
        rf: RF-TRD-008
        created: "2026-01-25"

      - name: TradeJournalPanel.tsx
        purpose: "Journal de trades con analisis y notas"
        epic: OQI-003
        rf: RF-TRD-009

      # Advanced Market Depth Components (OQI-003)
      - name: OrderBookDepthVisualization.tsx
        purpose: "Visualizacion grafica de profundidad del order book"
        epic: OQI-003
        rf: RF-TRD-010
        created: "2026-01-25"
        lines: 420

      - name: MarketDepthPanel.tsx
        purpose: "Panel completo de market depth con tabla y filtros"
        epic: OQI-003
        rf: RF-TRD-011
        created: "2026-01-25"
        lines: 380

      - name: SymbolComparisonChart.tsx
        purpose: "Chart de comparacion multi-simbolo con normalizacion"
        epic: OQI-003
        rf: RF-TRD-012
        created: "2026-01-25"
        lines: 450

      - name: TradingScreener.tsx
        purpose: "Screener avanzado con filtros y presets"
        epic: OQI-003
        rf: RF-TRD-013
        created: "2026-01-25"
        lines: 500
        created: "2026-01-25"

      - name: QuickOrderPanel.tsx
        purpose: "Panel compacto para ordenes rapidas one-click"
        epic: OQI-009
        rf: RF-MT4-004
        created: "2026-01-25"

      - name: TradeExecutionHistory.tsx
        purpose: "Historial de trades de sesion con estadisticas"
        epic: OQI-009
        rf: RF-MT4-005
        created: "2026-01-25"

      - name: TradingMetricsCard.tsx
        purpose: "Metricas diarias de trading y rendimiento"
        epic: OQI-009
        rf: RF-MT4-006
        created: "2026-01-25"

      - name: MT4LiveTradesPanel.tsx
        purpose: "Dashboard de posiciones en tiempo real con P&L y metricas agregadas"
        epic: OQI-009
        rf: RF-MT4-008
        created: "2026-01-25"

      - name: PositionModifierDialog.tsx
        purpose: "Modal para modificar SL/TP en posiciones abiertas con preview"
        epic: OQI-009
        rf: RF-MT4-009
        created: "2026-01-25"

      - name: RiskBasedPositionSizer.tsx
        purpose: "Calculadora de tamano de posicion basada en riesgo"
        epic: OQI-009
        rf: RF-MT4-010
        created: "2026-01-25"

      - name: TradeAlertsNotificationCenter.tsx
        purpose: "Hub unificado de notificaciones de eventos MT4"
        epic: OQI-009
        rf: RF-MT4-011
        created: "2026-01-25"

    hooks:
      - name: useMT4WebSocket.ts
        path: modules/trading/hooks/useMT4WebSocket.ts
        purpose: "Hook para conexion WebSocket MT4 en tiempo real"
        epic: OQI-009
        rf: RF-MT4-007
        created: "2026-01-25"
        exports:
          - useMT4WebSocket
          - MT4AccountInfo (type)
          - MT4Position (type)
          - MT4Order (type)

    # Trading Agents Components (Sprint 1, 2026-01-28)
    agents_components:
      - name: tradingAgents.types.ts
        path: types/tradingAgents.types.ts
        purpose: "Tipos TypeScript completos para trading bots"
        epic: OQI-003
        created: "2026-01-28"
        lines: 582

      - name: agents.service.ts
        path: services/agents.service.ts
        purpose: "API service layer para agentes"
        epic: OQI-003
        created: "2026-01-28"
        lines: 200

      - name: BotCard.tsx
        path: modules/trading/components/agents/BotCard.tsx
        purpose: "Tarjeta de bot con metricas y controles"
        epic: OQI-003
        created: "2026-01-28"
        lines: 280

      - name: AgentCard.tsx
        path: modules/trading/components/agents/AgentCard.tsx
        purpose: "Tarjeta de agente con estado y acciones"
        epic: OQI-003
        created: "2026-01-28"
        lines: 150

      - name: AgentsList.tsx
        path: modules/trading/components/agents/AgentsList.tsx
        purpose: "Lista con filtros y busqueda de agentes"
        epic: OQI-003
        created: "2026-01-28"
        lines: 200

      - name: AgentsPage.tsx
        path: modules/trading/pages/AgentsPage.tsx
        purpose: "Pagina principal de trading agents"
        route: /trading/agents
        epic: OQI-003
        created: "2026-01-28"
        lines: 250

    # ML Chart Overlays (Sprint 2, 2026-01-28)
    ml_overlay_components:
      - name: mlOverlay.types.ts
        path: types/mlOverlay.types.ts
        purpose: "Tipos MLPrediction, SignalMarker, ICTConcept"
        epic: OQI-006
        created: "2026-01-28"
        lines: 108

      - name: MLPredictionOverlay.tsx
        path: modules/trading/components/charts/overlays/MLPredictionOverlay.tsx
        purpose: "Overlay de predicciones ML en charts"
        epic: OQI-006
        created: "2026-01-28"
        lines: 102

      - name: SignalMarkers.tsx
        path: modules/trading/components/charts/overlays/SignalMarkers.tsx
        purpose: "Marcadores de senales en charts"
        epic: OQI-006
        created: "2026-01-28"
        lines: 72

      - name: ICTConceptsOverlay.tsx
        path: modules/trading/components/charts/overlays/ICTConceptsOverlay.tsx
        purpose: "Overlay de conceptos ICT/SMC"
        epic: OQI-006
        created: "2026-01-28"
        lines: 134

    # 2FA Components (Sprint 2, 2026-01-28)
    twofa_components:
      - name: TwoFactorSetup.tsx
        path: modules/auth/components/TwoFactorSetup.tsx
        purpose: "Wizard de 3 pasos para configurar 2FA"
        epic: OQI-001
        created: "2026-01-28"
        lines: 356

      - name: TwoFactorVerifyModal.tsx
        path: modules/auth/components/TwoFactorVerifyModal.tsx
        purpose: "Modal de verificacion 2FA en login"
        epic: OQI-001
        created: "2026-01-28"
        lines: 208

      - name: TwoFactorSettings.tsx
        path: modules/settings/components/TwoFactorSettings.tsx
        purpose: "Panel de configuracion 2FA en settings"
        epic: OQI-001
        created: "2026-01-28"
        lines: 398

    components_planned:
      - name: AMDZoneIndicator.tsx
        purpose: "Indicador de zonas AMD"

      - name: LiveTradingPanel.tsx
        purpose: "Panel principal de trading en vivo MT4"
        epic: OQI-009

  # --------------------------------------------------------------------------
  # INVESTMENT - Cuentas de inversion
  # --------------------------------------------------------------------------
  - name: investment
    path: modules/investment/
    epic: OQI-004
    status: implemented
    description: "Productos, cuentas, rendimiento"
    created: "2026-01-25"

    pages:
      - name: Investment.tsx
        route: /investment
        description: "Pagina de inversiones"
        rf: RF-INV-001

    pages_planned:
      - name: Products.tsx
        route: /investment/products
        description: "Catalogo de productos"

      - name: AccountDetail.tsx
        route: /investment/accounts/:id
        description: "Detalle de cuenta"

      - name: OpenAccount.tsx
        route: /investment/open-account
        description: "Abrir cuenta nueva"

    components:
      # Form Components (existing)
      - name: DepositForm.tsx
        purpose: "Formulario de deposito con integracion Stripe"
        rf: RF-INV-002

      - name: WithdrawForm.tsx
        purpose: "Formulario de retiro (banco/crypto)"
        rf: RF-INV-003

      # Account Components (OQI-004)
      - name: AccountSummaryCard.tsx
        purpose: "Tarjeta resumen de cuenta de inversion con metricas clave"
        epic: OQI-004
        rf: RF-INV-004
        created: "2026-01-25"

      - name: ProductComparisonTable.tsx
        purpose: "Tabla comparativa de productos Atlas/Orion/Nova"
        epic: OQI-004
        rf: RF-INV-005
        created: "2026-01-25"

      - name: PerformanceWidgetChart.tsx
        purpose: "Grafico sparkline de rendimiento para embeber en cards"
        epic: OQI-004
        rf: RF-INV-006
        created: "2026-01-25"

      - name: AccountSettingsPanel.tsx
        purpose: "Panel de configuracion de cuenta (distribucion, reinversion, alertas)"
        epic: OQI-004
        rf: RF-INV-007
        created: "2026-01-25"

      - name: index.ts
        purpose: "Exports de componentes de investment"

    components_planned:
      - name: ProductCard.tsx
        purpose: "Tarjeta de producto (Atlas/Orion/Nova)"

      - name: BotSelector.tsx
        purpose: "Selector de bot/agente"

  # --------------------------------------------------------------------------
  # SETTINGS - Configuracion
  # --------------------------------------------------------------------------
  - name: settings
    path: modules/settings/
    epic: OQI-001
    status: structure_only
    description: "Configuracion de usuario"

    pages:
      - name: Settings.tsx
        route: /settings
        description: "Pagina de configuracion"

    pages_planned:
      - name: Profile.tsx
        route: /settings/profile
        description: "Editar perfil"

      - name: Security.tsx
        route: /settings/security
        description: "Seguridad y 2FA"

      - name: Notifications.tsx
        route: /settings/notifications
        description: "Preferencias de notificaciones"

      - name: Billing.tsx
        route: /settings/billing
        description: "Suscripcion y pagos"

  # --------------------------------------------------------------------------
  # NOTIFICATIONS - Centro de notificaciones
  # --------------------------------------------------------------------------
  - name: notifications
    path: modules/notifications/
    epic: OQI-001
    status: implemented
    description: "Centro de notificaciones con bell, dropdown y pagina completa"
    created: "2026-01-25"

    pages:
      - name: NotificationsPage.tsx
        route: /notifications
        description: "Pagina completa de notificaciones con filtros"
        rf: RF-AUTH-001

    components:
      - name: NotificationBell.tsx
        purpose: "Icono de campana con badge de no leidas"
        rf: RF-AUTH-001

      - name: NotificationDropdown.tsx
        purpose: "Dropdown con ultimas 10 notificaciones"
        rf: RF-AUTH-001

      - name: NotificationItem.tsx
        purpose: "Item individual de notificacion"
        rf: RF-AUTH-001

      - name: index.ts
        purpose: "Exports de componentes"

    store:
      - name: notificationStore.ts
        path: stores/notificationStore.ts
        purpose: "Estado de notificaciones con Zustand"
        state:
          - notifications
          - unreadCount
          - preferences
          - loading
          - error
        actions:
          - fetchNotifications()
          - fetchUnreadCount()
          - markAsRead(id)
          - markAllAsRead()
          - addNotification(notification)
          - initializeWebSocket()

    service:
      - name: notification.service.ts
        path: services/notification.service.ts
        purpose: "API client para notificaciones"
        methods:
          - getNotifications(params)
          - getUnreadCount()
          - markAsRead(id)
          - markAllAsRead()
          - getPreferences()
          - updatePreferences(data)

  # --------------------------------------------------------------------------
  # PAYMENTS - Pagos y Stripe
  # --------------------------------------------------------------------------
  - name: payments
    path: modules/payments/
    epic: OQI-005
    status: implemented
    description: "Planes, suscripciones, checkout, wallet"
    created: "2026-01-25"

    pages:
      - name: Pricing.tsx
        route: /pricing
        description: "Catalogo de planes de suscripcion"
        rf: RF-PAY-001

      - name: Billing.tsx
        route: /billing, /settings/billing
        description: "Gestion de suscripcion, metodos de pago, facturas y wallet"
        rf: RF-PAY-002

      - name: CheckoutSuccess.tsx
        route: /payments/success
        description: "Pagina de confirmacion de pago exitoso"
        rf: RF-PAY-003

      - name: CheckoutCancel.tsx
        route: /payments/cancel
        description: "Pagina de cancelacion de checkout"
        rf: RF-PAY-003

    components:
      - name: PricingCard.tsx
        path: components/payments/PricingCard.tsx
        purpose: "Tarjeta de plan con features y precio"
        rf: RF-PAY-001

      - name: SubscriptionCard.tsx
        path: components/payments/SubscriptionCard.tsx
        purpose: "Tarjeta de suscripcion activa"
        rf: RF-PAY-002

      - name: WalletCard.tsx
        path: components/payments/WalletCard.tsx
        purpose: "Tarjeta de wallet con balance y transacciones"
        rf: RF-PAY-004

      - name: UsageProgress.tsx
        path: components/payments/UsageProgress.tsx
        purpose: "Barras de progreso de uso de features"
        rf: RF-PAY-002

      - name: WalletDepositModal.tsx
        path: components/payments/WalletDepositModal.tsx
        purpose: "Modal para depositar fondos al wallet"
        rf: RF-PAY-004

      - name: WalletWithdrawModal.tsx
        path: components/payments/WalletWithdrawModal.tsx
        purpose: "Modal para retirar fondos del wallet"
        rf: RF-PAY-004

      - name: index.ts
        path: components/payments/index.ts
        purpose: "Exports de componentes de payments"

      - name: CouponForm.tsx
        path: components/payments/CouponForm.tsx
        purpose: "Formulario para aplicar codigos de descuento"
        rf: RF-PAY-005
        created: "2026-01-25"

      - name: PaymentMethodForm.tsx
        path: components/payments/PaymentMethodForm.tsx
        purpose: "Formulario para agregar metodos de pago con validacion de tarjeta"
        rf: RF-PAY-002
        created: "2026-01-25"

      - name: BillingInfoForm.tsx
        path: components/payments/BillingInfoForm.tsx
        purpose: "Formulario para editar direccion de facturacion e info fiscal"
        rf: RF-PAY-002
        created: "2026-01-25"

      - name: TransactionHistory.tsx
        path: components/payments/TransactionHistory.tsx
        purpose: "Historial de transacciones de wallet con filtros y paginacion"
        rf: RF-PAY-004
        created: "2026-01-25"

    store:
      - name: paymentStore.ts
        path: stores/paymentStore.ts
        purpose: "Estado de pagos y suscripciones con Zustand"
        state:
          - currentSubscription
          - paymentMethods
          - invoices
          - usageStats
          - wallet
          - walletTransactions
          - loading states
        actions:
          - fetchCurrentSubscription()
          - fetchPaymentMethods()
          - fetchInvoices()
          - fetchUsageStats()
          - fetchWallet()
          - cancelSubscription()
          - reactivateSubscription()
          - setDefaultPaymentMethod()
          - removePaymentMethod()
          - downloadInvoice()
          - openBillingPortal()

    service:
      - name: payment.service.ts
        path: services/payment.service.ts
        purpose: "API client para pagos y Stripe"
        methods:
          - getSubscription()
          - getPaymentMethods()
          - getInvoices()
          - createCheckoutSession()
          - cancelSubscription()
          - getWallet()
          - depositToWallet()
          - withdrawFromWallet()

  # --------------------------------------------------------------------------
  # ML - Machine Learning Signals
  # --------------------------------------------------------------------------
  - name: ml
    path: modules/ml/
    epic: OQI-006
    status: implemented
    description: "ML predictions, signals, confidence, backtesting"
    created: "2026-01-25"

    components:
      # Core ML Components (existing)
      - name: AMDPhaseIndicator.tsx
        purpose: "Indicador de fases AMD (Accumulation, Manipulation, Distribution)"
        rf: RF-ML-001

      - name: PredictionCard.tsx
        purpose: "Tarjeta de prediccion con direccion y confianza"
        rf: RF-ML-001

      - name: SignalsTimeline.tsx
        purpose: "Timeline de senales generadas"
        rf: RF-ML-002

      - name: AccuracyMetrics.tsx
        purpose: "Metricas de precision de modelos"
        rf: RF-ML-003

      - name: ICTAnalysisCard.tsx
        purpose: "Analisis ICT/SMC con zonas de liquidez"
        rf: RF-ML-004

      - name: EnsembleSignalCard.tsx
        purpose: "Senal consolidada de ensemble de modelos"
        rf: RF-ML-005

      - name: TradeExecutionModal.tsx
        purpose: "Modal para ejecutar trade basado en senal"
        rf: RF-ML-006

      # Confidence & Performance Components (OQI-006)
      - name: ConfidenceMeter.tsx
        purpose: "Medidor avanzado de confianza con modelo agreement y feature importance"
        epic: OQI-006
        rf: RF-ML-007
        created: "2026-01-25"

      - name: SignalPerformanceTracker.tsx
        purpose: "Tracker de historial y performance de senales con filtros y estadisticas"
        epic: OQI-006
        rf: RF-ML-008
        created: "2026-01-25"

      - name: ModelAccuracyDashboard.tsx
        purpose: "Dashboard de precision individual de modelos con comparacion"
        epic: OQI-006
        rf: RF-ML-009
        created: "2026-01-25"

      - name: BacktestResultsVisualization.tsx
        purpose: "Visualizacion de resultados de backtesting con trades y returns mensuales"
        epic: OQI-006
        rf: RF-ML-010
        created: "2026-01-25"

      - name: index.ts
        purpose: "Exports de componentes ML"

# ============================================================================
# COMPONENTES COMPARTIDOS
# ============================================================================
shared_components:
  layout:
    - name: MainLayout.tsx
      path: components/layout/MainLayout.tsx
      purpose: "Layout principal con sidebar"

    - name: AuthLayout.tsx
      path: components/layout/AuthLayout.tsx
      purpose: "Layout para paginas de auth"

  planned:
    - name: Navbar.tsx
      purpose: "Barra de navegacion"

    - name: Sidebar.tsx
      purpose: "Menu lateral"

    - name: Footer.tsx
      purpose: "Pie de pagina"

    - name: LoadingSpinner.tsx
      purpose: "Indicador de carga"

    - name: ErrorBoundary.tsx
      purpose: "Manejo de errores"

    - name: Modal.tsx
      purpose: "Componente modal base"

    - name: Toast.tsx
      purpose: "Notificaciones toast"

# ============================================================================
# ROUTING
# ============================================================================
routing:
  file: App.tsx
  routes:
    public:
      - path: /login
        component: Login
      - path: /register
        component: Register
      - path: /forgot-password
        component: ForgotPassword
      - path: /reset-password
        component: ResetPassword
      - path: /verify-email
        component: VerifyEmail
      - path: /auth/callback
        component: AuthCallback

    protected:
      - path: /dashboard
        component: Dashboard
      - path: /courses
        component: Courses
      - path: /courses/:slug
        component: CourseDetail
      - path: /trading
        component: Trading
      - path: /trading/agents
        component: AgentsPage
        created: "2026-01-28"
      - path: /investment
        component: Investment
      - path: /settings
        component: Settings
      - path: /notifications
        component: NotificationsPage
      - path: /settings/notifications
        component: NotificationsPage
      - path: /pricing
        component: Pricing
      - path: /billing
        component: Billing
      - path: /settings/billing
        component: Billing
      - path: /payments/success
        component: CheckoutSuccess
      - path: /payments/cancel
        component: CheckoutCancel

# ============================================================================
# STORES (ZUSTAND)
# ============================================================================
stores:
  implemented:
    - name: notificationStore
      path: stores/notificationStore.ts
      purpose: "Estado de notificaciones"
      state:
        - notifications
        - unreadCount
        - preferences
        - loading
        - error
      actions:
        - fetchNotifications()
        - fetchUnreadCount()
        - markAsRead()
        - markAllAsRead()
        - addNotification()
        - initializeWebSocket()
      created: "2026-01-25"

    - name: chatStore
      path: stores/chatStore.ts
      purpose: "Estado de LLM Copilot chat"
      state:
        - sessions
        - currentSessionId
        - messages
        - loading
        - isOpen
        - error
      actions:
        - createNewSession()
        - loadSessions()
        - loadSession()
        - sendMessage()
        - deleteSession()
        - toggleChat()
      created: "2026-01-25"

    - name: agentsStore
      path: stores/agentsStore.ts
      purpose: "Estado de trading agents y bots"
      lines: 550
      state:
        - agents
        - bots
        - selectedAgent
        - selectedBot
        - filters
        - loading
        - error
      actions:
        - fetchAgents()
        - fetchBots()
        - createAgent()
        - updateAgent()
        - deleteAgent()
        - startBot()
        - stopBot()
        - updateBotConfig()
      created: "2026-01-28"
      sprint: "Sprint 1 - P0"

  planned:
    - name: authStore
      purpose: "Estado de autenticacion"
      state:
        - user
        - isAuthenticated
        - accessToken
      actions:
        - login()
        - logout()
        - refreshToken()

    - name: tradingStore
      purpose: "Estado de trading"
      state:
        - selectedSymbol
        - timeframe
        - watchlists
        - positions
      actions:
        - setSymbol()
        - addToWatchlist()
        - placeOrder()

    - name: educationStore
      purpose: "Estado de educacion"
      state:
        - enrolledCourses
        - currentLesson
        - progress
      actions:
        - enrollCourse()
        - updateProgress()

    - name: uiStore
      purpose: "Estado de UI"
      state:
        - theme
        - sidebarOpen
        - notifications
      actions:
        - toggleTheme()
        - toggleSidebar()
        - showNotification()

# ============================================================================
# HOOKS PERSONALIZADOS
# ============================================================================
hooks:
  implemented:
    - name: useMlOverlayData
      path: hooks/charts/useMlOverlayData.ts
      purpose: "TanStack Query hook para datos de overlay ML"
      epic: OQI-006
      created: "2026-01-28"
      sprint: "Sprint 2 - P1"
      lines: 93
      returns:
        - predictions
        - signals
        - ictConcepts
        - isLoading
        - error
        - refetch

  planned:
    - name: useAuth
      purpose: "Hook de autenticacion"
      returns: [user, isLoading, login, logout]

    - name: useApi
      purpose: "Hook para llamadas API"
      returns: [data, error, isLoading, refetch]

    - name: useTradingChart
      purpose: "Hook para manejo de charts"

    - name: useWebSocket
      purpose: "Hook para conexiones WebSocket"

    - name: useNotification
      purpose: "Hook para notificaciones"

# ============================================================================
# MAPEO A EPICAS
# ============================================================================
epic_mapping:
  OQI-001:
    features: [auth, dashboard, settings]
    pages_count: 8
    status: "Parcialmente implementado"

  OQI-002:
    features: [education]
    pages_count: 6
    components_count: 8
    status: "En Desarrollo (85%)"
    note: "CertificatePreview, CourseReviews, LessonNotes, RecommendedCourses, CourseProgressTracker, LearningPathVisualizer, VideoProgressPlayer, AssessmentSummaryCard"

  OQI-003:
    features: [trading]
    pages_count: 1
    components_count: 23
    status: "En Desarrollo (80%)"
    note: "Chart components, indicators, drawing tools, symbol info, trade journal"

  OQI-004:
    features: [investment]
    pages_count: 1
    components_count: 6
    status: "En Desarrollo (85%)"
    note: "DepositForm, WithdrawForm, AccountSummaryCard, ProductComparisonTable, PerformanceWidgetChart, AccountSettingsPanel"

  OQI-005:
    features: [payments]
    pages_count: 4
    components_count: 14
    status: "Implementado (85%)"
    note: "Pricing, Billing, CheckoutSuccess, CheckoutCancel, WalletDepositModal, WalletWithdrawModal, CouponForm, PaymentMethodForm, BillingInfoForm, TransactionHistory, InvoiceList, InvoiceDetail, PaymentMethodsList, SubscriptionUpgradeFlow"

  OQI-006:
    features: [ml]
    pages_count: 0
    components_count: 11
    status: "En Desarrollo (85%)"
    note: "AMDPhaseIndicator, PredictionCard, SignalsTimeline, AccuracyMetrics, ICTAnalysisCard, EnsembleSignalCard, TradeExecutionModal, ConfidenceMeter, SignalPerformanceTracker, ModelAccuracyDashboard, BacktestResultsVisualization"

  OQI-007:
    features: [assistant]
    pages_count: 1
    components_count: 18
    hooks_count: 2
    utils_count: 1
    status: "En Desarrollo (90%)"
    note: "Complete UI + AnalysisRequestForm, StrategyTemplateSelector, LLMConfigPanel, ContextMemoryDisplay + existing components"

  OQI-008:
    features: []
    pages_count: 0
    status: "Planificado"
    note: "Feature portfolio a crear"

  OQI-009:
    features: [trading]
    pages_count: 0
    components_count: 13
    hooks_count: 1
    status: "En Desarrollo (85%)"
    note: "MT4ConnectionStatus, LivePositionCard, RiskMonitor, MT4PositionsManager, AdvancedOrderEntry, AccountHealthDashboard, QuickOrderPanel, TradeExecutionHistory, TradingMetricsCard, MT4LiveTradesPanel, PositionModifierDialog, RiskBasedPositionSizer, TradeAlertsNotificationCenter, useMT4WebSocket"

# ============================================================================
# DEPENDENCIAS PRINCIPALES
# ============================================================================
dependencies:
  production:
    - react: "^18.x"
    - react-dom: "^18.x"
    - react-router-dom: "^6.x"
    - typescript: "^5.x"
    - zustand: "^4.x"
    - tailwindcss: "^3.x"
    - "@tanstack/react-query": "^5.x"
    - axios: "^1.x"
    - lightweight-charts: "^4.x"
    - lucide-react: "^0.x"

  development:
    - vite: "^5.x"
    - "@types/react": "^18.x"
    - "@vitejs/plugin-react": "^4.x"
    - autoprefixer: "^10.x"
    - postcss: "^8.x"

# ============================================================================
# ARCHIVOS CLAVE
# ============================================================================
key_files:
  - path: apps/frontend/src/main.tsx
    purpose: "Entry point de la aplicacion"

  - path: apps/frontend/src/App.tsx
    purpose: "Componente raiz con routing"

  - path: apps/frontend/tailwind.config.js
    purpose: "Configuracion de Tailwind"

  - path: apps/frontend/vite.config.ts
    purpose: "Configuracion de Vite"

  - path: apps/frontend/package.json
    purpose: "Dependencias y scripts"

# ============================================================================
# NOTAS Y PENDIENTES
# ============================================================================
notes:
  - "Solo auth tiene implementacion real, resto son paginas placeholder"
  - "Falta crear stores Zustand"
  - "Falta crear hooks personalizados"
  - "Falta integracion con API del backend"
  - "Falta componente TradingChart con Lightweight Charts"
  - "Falta feature Copilot (OQI-007)"
  - "Falta feature Portfolio (OQI-008)"
  - "Tests E2E pendientes"

# ============================================================================
# FIN DEL INVENTARIO
# ============================================================================
