- Created ENDPOINT-ROUTING.md with complete API routing documentation
- Documented all 12 modules with their endpoints and methods
- Included authentication requirements and access control
- Documented request/response formats and pagination
- Referenced centralized route constants file
- Added middleware stack documentation
- Included error handling and success response formats
This documentation provides a comprehensive guide to the backend API
structure, making it easier for developers to understand and use the
endpoints. All routes are organized by module following RESTful conventions.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Added RiskQuestionnaireResponse interface for risk questionnaire responses
- Added WithdrawalDestinationDetails interface for withdrawal destinations
- Added SnapshotAllocationData interface for portfolio snapshot allocations
- Added TradingBotStrategyConfig interface for bot strategy configuration
All major JSONB fields now have proper TypeScript interfaces instead of
generic Record<string, unknown>. This improves type safety and code clarity.
Note: ML module already had proper JSONB typing (TrainingMetrics, etc.)
Note: Education module JSONB typing was completed in ST1.5
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Created apps/backend/src/modules/portfolio/types/portfolio.types.ts
- Consolidated all portfolio type definitions from DDL
- Updated repositories to import from centralized types
- Updated service to use centralized types (removed duplicates)
- Updated controller to import RiskProfile from types
- Removed 73 lines of duplicate type definitions
Fixes coherence gap E-COH-004 where portfolio types were absent in backend.
All types now align with DDL schema (portfolio.* enums and tables).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Import and initialize portfolioWebSocket in index.ts
- Add graceful shutdown for portfolioWebSocket
- Enable real-time portfolio updates via WebSocket
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add portfolio.websocket.ts for real-time portfolio updates
- Add snapshot.repository.ts for historical performance data
- Add getPortfolioPerformance and getPerformanceStats endpoints
- Update routes with /performance and /performance/stats
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Created portfolio.repository.ts with CRUD operations for portfolios and allocations
- Created goal.repository.ts with CRUD operations for portfolio goals
- Updated portfolio.service.ts to use repositories with in-memory fallback
- Migrated createPortfolio, getPortfolio, getUserPortfolios methods
- Migrated updateAllocations, executeRebalance methods
- Migrated createGoal, getUserGoals, updateGoalProgress, deleteGoal methods
- Added helper functions for mapping between repo and service types
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- withdrawal.repository.ts: CRUD for withdrawal_requests table
- distribution.repository.ts: CRUD for profit_distributions table
- product.repository.ts: CRUD for products table with DB/in-memory fallback
- transaction.service.ts: Migrated withdrawal and distribution to repositories
- product.service.ts: Added DB support with in-memory defaults fallback
All investment entities now persist to PostgreSQL instead of in-memory storage.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- account.service.ts: Now uses accountRepository instead of in-memory Map
- transaction.service.ts: Now uses transactionRepository for transactions
- Added account.repository.ts with full CRUD and balance operations
- Added transaction.repository.ts with query, create, and update operations
- Withdrawal and distribution entities still use in-memory storage
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Firebase client for FCM push notifications
- Update notification service with push token management
- Add push token registration/removal endpoints
- Update all queries to use auth schema
- Add comprehensive unit tests for notification.service
- Add unit tests for distribution.job
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
NestJS backend with:
- Authentication (JWT)
- WebSocket real-time support
- ML integration services
- Payments module
- User management
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>