- Add users.service.ts with getProfile, updateProfile, updateAvatar,
changePassword, getPublicProfile, and deleteAccount methods
- Add users.types.ts with UserProfile, UpdateProfileInput, PublicProfile interfaces
- Add update-profile.dto.ts with Zod validation schemas
- Add module index.ts for clean exports
- Update users.routes.ts with new endpoints:
- PUT /api/v1/users/me (update profile)
- PUT /api/v1/users/me/avatar (update avatar)
- PUT /api/v1/users/me/password (change password)
- GET /api/v1/users/:id/public (view public profile)
- DELETE /api/v1/users/me (soft delete account)
- Update users.controller.ts with service integration and validation
All endpoints require authentication. Password operations use bcrypt.
Account deletion is soft-delete (sets deactivated_at timestamp).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
SUBTASK-002: Auth session details
- Extend Session type with deviceType, deviceName, browser, os, countryCode, city
- getSessions controller now returns extended device information
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
New methods:
- calculateRebalance: Calculates trades needed for rebalancing
- getPerformanceMetrics: Returns volatility, Sharpe ratio, drawdown
- createSnapshot: Creates NAV snapshot for historical tracking
- getGoalProgress: Calculates goal progress with projections
New routes:
- GET /:portfolioId/rebalance/calculate
- GET /:portfolioId/metrics
- POST /:portfolioId/snapshot
- GET /goals/:goalId/progress
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Created feature-flags.service.ts with full CRUD + evaluation
- Created feature-flags.controller.ts with 12 endpoints
- Created feature-flags.routes.ts with auth/admin middleware
- Registered routes in main index.ts
Endpoints:
- GET/POST /feature-flags (admin)
- GET /feature-flags/evaluate (user)
- GET /feature-flags/check/:code (user)
- User override management
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add proxy module with types, service, controller, and routes
- Configure llmAgent and dataService in config
- Register proxy routes in main Express app
- All Python service access now goes through authenticated Express gateway
ARCH-001: Centralized proxy with auth, logging, and error handling
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Created complete reviews module for education courses:
- types/reviews.types.ts: Type definitions aligned with DDL
- services/reviews.service.ts: Business logic for reviews
- controllers/reviews.controller.ts: HTTP endpoints
- Updated education.routes.ts with review routes
Features:
- Create/update/delete reviews (users)
- Get reviews by course with filters
- Rating summary and distribution
- Mark reviews as helpful (toggle vote)
- Approve/feature reviews (admin)
- Automatic course rating stats update
Endpoints:
- GET /courses/:courseId/reviews
- GET /courses/:courseId/reviews/summary
- POST /courses/:courseId/reviews
- PUT /reviews/:reviewId
- DELETE /reviews/:reviewId
- POST /reviews/:reviewId/helpful
- POST /reviews/:reviewId/approve (admin)
- POST /reviews/:reviewId/feature (admin)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implemented complete currency exchange module with the following features:
**New Files:**
- types/currency.types.ts: Type definitions for exchange rates and conversions
- services/currency.service.ts: Service with Redis caching (TTL 5min)
- controllers/currency.controller.ts: Request handlers for all endpoints
- currency.routes.ts: Route definitions
- index.ts: Module exports
**Endpoints:**
- GET /api/v1/currency/rates/:from/:to - Get exchange rate between currencies
- GET /api/v1/currency/rates/:baseCurrency - Get all rates for base currency
- POST /api/v1/currency/convert - Convert amounts between currencies
- PUT /api/v1/currency/rates - Update exchange rate (admin only)
**Features:**
- Redis caching with 5-minute TTL
- Automatic inverse rate calculation
- Historical rate support via temporal validity
- Input validation and error handling
- Integration with financial.currency_exchange_rates table
**Integration:**
- Registered routes in src/index.ts
- Follows existing module patterns (ml, market-data)
- No placeholders or TODOs
- Build and lint passing
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add @aws-sdk/client-s3 and @aws-sdk/s3-request-presigner dependencies
- Add storage config section to config/index.ts
- Fix users.controller.ts imports (db, AuthenticatedRequest, logger)
- Update education.types.ts with backward-compatible alias properties
- Add missing interfaces: LessonResource, QuizOption
- Change QuizQuestion.options from Record to QuizOption[]
- Fix education services to align with updated types
- Export ML service types properly in ml.module.ts
- Fix portfolio/snapshot.repository.ts type cast
- Fix trading/order.service.ts number type
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement MVP video processing service for education module:
- Video transcoding to multiple resolutions (1080p, 720p, 480p)
- Thumbnail generation from video
- Metadata extraction (duration, codec, dimensions)
- Mock/placeholder implementation for MVP
- Extensive TODO comments for production FFmpeg/MediaConvert integration
Technical Details:
- Storage integration with S3/R2 via storage.service
- Returns mock metadata for MVP (can upgrade to real processing later)
- Supports queueing for background processing
- Clear upgrade path documented in code comments
Files:
- src/shared/services/video-processing.service.ts (NEW): Video processing service
- src/modules/education/services/video.service.ts (UPDATED): Import processing service
Status: BLOCKER-003 (ST4.3) - 67% complete
Task: #9 ST4.3.4 - Backend video processing service
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>