trading-platform/orchestration/tareas/_archive/2026-01/TASK-2026-01-25-PHASE1-MVP/03-PLANEACION.md
Adrian Flores Cortes df43dd90cb [F0-F2] feat: Coherence analysis baseline + entity types + frontend stores
FASE 0 - Preparación y Purga:
- Archived 21 completed tasks to _archive/2026-01/
- Marked 4 docs as DEPRECATED
- Created 3 baseline coherence reports

FASE 1 - DDL-Backend Coherence:
- audit.types.ts: +4 types (SystemEvent, TradingAudit, ApiRequestLog, DataAccessLog)
- investment.types.ts: +4 types (RiskQuestionnaire, WithdrawalRequest, DailyPerformance, DistributionHistory)
- entity.types.ts: +5 types (Symbol, TradingBot, TradingSignal, TradingMetrics, PaperBalance)

FASE 2 - Backend-Frontend Coherence:
- investmentStore.ts: New Zustand store with 20+ actions
- mlStore.ts: New Zustand store with signal caching
- alerts.service.ts: New service with 15 functions

FASE 3 - Documentation:
- OQI-009: Updated to 100% coverage, added ET-MKT-004-productos.md
- OQI-010: Created full structure (STATUS.md, ROADMAP-MT4.md, ET-MT4-001-gateway.md)

Coherence Baseline Established:
- DDL-Backend: 31% (target 95%)
- Backend-Frontend: 72% (target 85%)
- Global: 39.6% (target 90%)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 22:08:04 -06:00

2.3 KiB

03-PLANEACION - Phase 1 MVP Implementation

Plan de Implementación

Task 10: Servicio de Notificaciones

Archivos a Crear

  1. notification.service.ts (~500 líneas)

    • Clase NotificationService
    • Métodos: sendNotification, sendBulkNotification, broadcastNotification
    • Canales: in_app (WebSocket), email, push
    • Preferencias de usuario (quiet hours, disabled types)
    • Templates de email por tipo
  2. notification.controller.ts (~180 líneas)

    • getNotifications, getUnreadCount
    • markAsRead, markAllAsRead
    • deleteNotification
    • getPreferences, updatePreferences
  3. notification.routes.ts (~50 líneas)

    • GET /notifications
    • GET /notifications/unread-count
    • GET /notifications/preferences
    • PATCH /notifications/preferences
    • POST /notifications/read-all
    • PATCH /notifications/:id/read
    • DELETE /notifications/:id
  4. index.ts (exports)

Modificaciones

  1. alerts.service.ts: Integrar con notificationService en triggerAlert()
  2. index.ts: Agregar notificationRouter a API routes

Task 11: Distribution Job

Archivos a Crear

  1. distribution.job.ts (~300 líneas)

    • Clase DistributionJob
    • Scheduler: setInterval para 00:00 UTC
    • Métodos: run, getActiveAccounts, distributeReturns
    • Cálculo de retornos diarios basado en producto
    • Aplicación de performance fees
    • Registro en distribution_history
    • Notificación a usuarios
  2. index.ts (exports)

Modificaciones

  1. index.ts: Inicializar distributionJob.start() al arrancar servidor

Orden de Implementación

1. notification.service.ts     [Core]
2. notification.controller.ts  [API]
3. notification.routes.ts      [Routing]
4. notifications/index.ts      [Exports]
5. Modificar alerts.service.ts [Integración]
6. distribution.job.ts         [Core]
7. investment/jobs/index.ts    [Exports]
8. Modificar main index.ts     [Startup]

Criterios de Aceptación

  • Notificaciones en tiempo real via WebSocket
  • Emails enviados con templates correctos
  • API REST funcional para gestión de notificaciones
  • Alertas de precio envían notificaciones automáticamente
  • Distribution job programado para 00:00 UTC
  • Cálculo correcto de rendimientos por producto
  • Historial de distribuciones registrado
  • TypeScript compila sin errores