diff --git a/CHANGELOG.md b/CHANGELOG.md index 13f33d4854..2d57e73d3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Added + +- Extended the export functionality by the platforms +- Extended the _Trackinsight_ data enhancer for asset profile data by `cusip` +- Added _Storybook_ to the build process + ## 2.141.0 - 2025-02-25 ### Added diff --git a/apps/api/src/app/export/export.service.ts b/apps/api/src/app/export/export.service.ts index 219ffffda7..8d7585c01d 100644 --- a/apps/api/src/app/export/export.service.ts +++ b/apps/api/src/app/export/export.service.ts @@ -5,6 +5,7 @@ import { TagService } from '@ghostfolio/api/services/tag/tag.service'; import { Filter, Export } from '@ghostfolio/common/interfaces'; import { Injectable } from '@nestjs/common'; +import { Platform } from '@prisma/client'; @Injectable() export class ExportService { @@ -25,15 +26,37 @@ export class ExportService { userCurrency: string; userId: string; }): Promise { + const platforms: Platform[] = []; + const accounts = ( await this.accountService.accounts({ + include: { + Platform: true + }, orderBy: { name: 'asc' }, where: { userId } }) ).map( - ({ balance, comment, currency, id, isExcluded, name, platformId }) => { + ({ + balance, + comment, + currency, + id, + isExcluded, + name, + platformId, + Platform: platform + }) => { + if ( + !platforms.some(({ id: currentPlatformId }) => { + return currentPlatformId === platform.id; + }) + ) { + platforms.push(platform); + } + return { balance, comment, @@ -76,6 +99,7 @@ export class ExportService { return { meta: { date: new Date().toISOString(), version: environment.version }, accounts, + platforms, tags, activities: activities.map( ({ diff --git a/apps/api/src/services/data-provider/data-enhancer/trackinsight/trackinsight.service.ts b/apps/api/src/services/data-provider/data-enhancer/trackinsight/trackinsight.service.ts index 2b8eaf2e91..32b494085e 100644 --- a/apps/api/src/services/data-provider/data-enhancer/trackinsight/trackinsight.service.ts +++ b/apps/api/src/services/data-provider/data-enhancer/trackinsight/trackinsight.service.ts @@ -71,7 +71,13 @@ export class TrackinsightDataEnhancerService implements DataEnhancerInterface { return {}; }); - const isin = profile?.isin?.split(';')?.[0]; + const cusip = profile?.cusip; + + if (cusip) { + response.cusip = cusip; + } + + const isin = profile?.isins?.[0]; if (isin) { response.isin = isin; diff --git a/apps/api/src/services/queues/data-gathering/data-gathering.service.ts b/apps/api/src/services/queues/data-gathering/data-gathering.service.ts index b79b2a0985..b3e7de0b3e 100644 --- a/apps/api/src/services/queues/data-gathering/data-gathering.service.ts +++ b/apps/api/src/services/queues/data-gathering/data-gathering.service.ts @@ -200,6 +200,7 @@ export class DataGatheringService { assetSubClass, countries, currency, + cusip, dataSource, figi, figiComposite, @@ -218,6 +219,7 @@ export class DataGatheringService { assetSubClass, countries, currency, + cusip, dataSource, figi, figiComposite, @@ -234,6 +236,7 @@ export class DataGatheringService { assetSubClass, countries, currency, + cusip, figi, figiComposite, figiShareClass, diff --git a/libs/common/src/lib/interfaces/export.interface.ts b/libs/common/src/lib/interfaces/export.interface.ts index 1257e50bcc..14a017428b 100644 --- a/libs/common/src/lib/interfaces/export.interface.ts +++ b/libs/common/src/lib/interfaces/export.interface.ts @@ -1,4 +1,4 @@ -import { Account, Order, Tag } from '@prisma/client'; +import { Account, Order, Platform, Tag } from '@prisma/client'; export interface Export { accounts: Omit[]; @@ -16,6 +16,7 @@ export interface Export { date: string; version: string; }; + platforms: Platform[]; tags: Omit[]; user: { settings: { currency: string } }; } diff --git a/libs/ui/project.json b/libs/ui/project.json index 1b3f0e4e71..4c8e6c1256 100644 --- a/libs/ui/project.json +++ b/libs/ui/project.json @@ -41,7 +41,7 @@ "executor": "@storybook/angular:build-storybook", "outputs": ["{options.outputDir}"], "options": { - "outputDir": "dist/storybook/ui", + "outputDir": "dist/apps/client/development/storybook", "configDir": "libs/ui/.storybook", "browserTarget": "ui:build-storybook", "compodoc": false, @@ -61,7 +61,7 @@ "executor": "@nx/web:file-server", "options": { "buildTarget": "ui:build-storybook", - "staticFilePath": "dist/storybook/ui" + "staticFilePath": "dist/storybook" }, "configurations": { "ci": { diff --git a/package.json b/package.json index 1921d650e2..213de68420 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "affected:test": "nx affected:test", "analyze:client": "nx run client:build:production --stats-json && webpack-bundle-analyzer -p 1234 dist/apps/client/en/stats.json", "angular": "node --max_old_space_size=32768 ./node_modules/@angular/cli/bin/ng", - "build:production": "nx run api:copy-assets && nx run api:build:production && nx run client:copy-assets && nx run client:build:production && npm run replace-placeholders-in-build", + "build:production": "nx run api:copy-assets && nx run api:build:production && nx run client:copy-assets && nx run client:build:production && nx run ui:build-storybook && npm run replace-placeholders-in-build", "build:storybook": "nx run ui:build-storybook", "database:format-schema": "prisma format", "database:generate-typings": "prisma generate",