feat: Support Stock Market Indices in Portfolio Performance#7
Merged
nenadjakic merged 7 commits intomainfrom Dec 18, 2025
Merged
feat: Support Stock Market Indices in Portfolio Performance#7nenadjakic merged 7 commits intomainfrom
nenadjakic merged 7 commits intomainfrom
Conversation
…s and add OpenAPI configuration
- Added INDEX asset type to AssetType enum - Created Index entity extending ListedAsset - Added Flyway migration to seed major indices (S&P500, NASDAQ, STOXX50, STOXX600) - Updated PortfolioChartResponse DTO to include indices data - Modified getPortfolioPerformanceChart REST API to accept optional indices parameter - Enhanced PortfolioService to calculate normalized index performance - Updated frontend Dashboard/Overview P&L chart to allow selecting benchmark indices - Regenerated OpenAPI specification Resolves: IN-1, IN-2, IN-3, IN-4
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive support for tracking major stock market indices (S&P 500, NASDAQ, STOXX 50, STOXX 600) to enable portfolio performance benchmarking. The implementation spans both backend and frontend, introducing a new INDEX asset type, database migrations for seeding index data, enhanced REST APIs for retrieving index performance, and UI components for index selection and visualization.
Key Changes:
- Added INDEX asset type with database migration to seed major market indices
- Enhanced portfolio performance API to accept optional indices parameter and calculate normalized percentage changes
- Updated frontend dashboard to display index selection UI with toggle buttons and visualize multiple series on the P&L chart
Reviewed changes
Copilot reviewed 26 out of 29 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
backend/data/src/main/kotlin/com/github/nenadjakic/investiq/data/enum/AssetType.kt |
Added INDEX enum value to AssetType |
backend/data/src/main/kotlin/com/github/nenadjakic/investiq/data/entity/asset/Index.kt |
Created new Index entity extending ListedAsset |
backend/data/src/main/resources/migrations/V20251216210219__add_index_asset_type_and_seed_indices.sql |
Migration to add INDEX type to constraint and seed major indices |
backend/service/src/main/kotlin/com/github/nenadjakic/investiq/service/PortfolioService.kt |
Added calculateIndicesPerformance method and injected required repositories |
backend/common/src/main/kotlin/com/github/nenadjakic/investiq/common/dto/PortfolioChartResponse.kt |
Added optional indices map to response DTO |
backend/app-rest/src/main/kotlin/com/github/nenadjakic/investiq/restapp/controller/PortfolioController.kt |
Added indices parameter to getPortfolioPerformanceChart endpoint |
backend/app-rest/build.gradle.kts |
Added OpenAPI generation configuration |
backend/app-cli/src/main/kotlin/com/github/nenadjakic/investiq/importer/command/TestCommand.kt |
Added test command (should be removed) |
backend/spring-shell.log |
Log file added (should be gitignored) |
frontend/src/dashboard/overview/overview.ts |
Added index selection logic and chart rendering for multiple series |
frontend/src/dashboard/overview/overview.html |
Added index toggle buttons UI |
frontend/src/reference-data/reference-data.ts |
Reset statistics to '0' (unrelated change) |
frontend/src/app/core/api/ |
Regenerated API client with updated types and endpoints |
frontend/openapi.json |
Updated OpenAPI specification |
frontend/package.json & frontend/package-lock.json |
Removed Angular Material dependencies |
frontend/src/custom-theme.scss |
Removed Angular Material theme file |
frontend/angular.json |
Removed custom theme reference |
Files not reviewed (1)
- frontend/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
backend/service/src/main/kotlin/com/github/nenadjakic/investiq/service/PortfolioService.kt
Outdated
Show resolved
Hide resolved
...ata/src/main/resources/migrations/V20251216210219__add_index_asset_type_and_seed_indices.sql
Outdated
Show resolved
Hide resolved
backend/data/src/main/kotlin/com/github/nenadjakic/investiq/data/entity/asset/Index.kt
Outdated
Show resolved
Hide resolved
backend/app-cli/src/main/kotlin/com/github/nenadjakic/investiq/importer/command/TestCommand.kt
Outdated
Show resolved
Hide resolved
backend/service/src/main/kotlin/com/github/nenadjakic/investiq/service/PortfolioService.kt
Show resolved
Hide resolved
…ta/entity/asset/Index.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/importer/command/TestCommand.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/service/PortfolioService.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…r and updating related methods
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds support for tracking major stock market indices (S&P 500, NASDAQ, STOXX 50, STOXX 600) in both backend and frontend, allowing users to compare their portfolio performance against market benchmarks.
Changes Made
Backend
AssetTypeenumListedAssetV20251216210219) to:getPortfolioPerformanceChart):indicesparameterPortfolioChartResponseDTO to include indices datacalculateIndicesPerformance()methodAssetRepositoryandAssetHistoryRepositoryFrontend
Acceptance Criteria Met
✅ New entity inherits
Assetand is reflected in the enum discriminator✅ Database is seeded with index data using Flyway migration
✅
getPortfolioPerformanceChartREST method supports selected indices✅ Frontend allows selecting indices on the Dashboard/Overview P&L chart
✅ OpenAPI specification is updated
Testing
Screenshots
N/A - Backend and frontend changes work together to enable index comparison
Resolves #IN-1, #IN-2, #IN-3, #IN-4