Commit Graph

1 Commits

Author SHA1 Message Date
Adrian Flores Cortes
3bb215b51b fix(coherence): Align backend types with DDL (E-COH-001, E-COH-003)
COHERENCIA FIXES P0 (ST1.1 + ST1.2 - 45min total)

ST1.1 (E-COH-001 - 15min):
- Fixed backend UserRole enum to match DDL
- Changed: investor→user, removed student/instructor, added analyst
- Deprecated requireInstructor guard (role doesn't exist in DDL)

ST1.2 (E-COH-003 - 30min):
- Created investment.types.ts with all enums from DDL
- Centralized types: TradingAgent, RiskProfile, AccountStatus,
  DistributionFrequency, TransactionType, TransactionStatus
- Updated all imports in repositories, services, controllers

Impact:
- Type safety across auth and investment modules
- Coherence with DDL (source of truth) guaranteed
- Eliminated type duplication and inconsistencies

Modified files:
- src/modules/auth/types/auth.types.ts
- src/core/guards/auth.guard.ts
- src/modules/investment/types/investment.types.ts (NEW)
- src/modules/investment/repositories/account.repository.ts
- src/modules/investment/services/account.service.ts
- src/modules/investment/services/product.service.ts
- src/modules/investment/controllers/investment.controller.ts

Task: TASK-2026-01-26-ANALYSIS-INTEGRATION-PLAN
Subtasks: ST1.1, ST1.2
Epics: OQI-001, OQI-004
Priority: P0

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 16:48:44 -06:00