Browse Source

Merge branch 'main' into feature/extend-analysis-page-values

pull/6210/head
Sven Günther 3 weeks ago
committed by GitHub
parent
commit
9e11e0124d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 5
      CHANGELOG.md
  2. 6
      apps/api/src/app/import/import.service.ts
  3. 1
      apps/api/src/app/portfolio/portfolio.service.ts
  4. 14
      apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts
  5. 4
      apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html
  6. 4
      libs/common/src/lib/interfaces/responses/portfolio-holding-response.interface.ts
  7. 8
      package-lock.json
  8. 2
      package.json

5
CHANGELOG.md

@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added value, change with currency effect and performance with currency effect to the analysis page
### Changed
- Deprecated `firstBuyDate` in favor of `dateOfFirstActivity` in the endpoint `GET api/v1/portfolio/holding/:dataSource/:symbol`
- Upgraded `countries-list` from version `3.2.0` to `3.2.2`
## 2.231.0 - 2026-01-17
### Changed

6
apps/api/src/app/import/import.service.ts

@ -82,7 +82,7 @@ export class ImportService {
filterBySymbol: symbol
});
const { firstBuyDate, historicalData } = holding;
const { dateOfFirstActivity, historicalData } = holding;
const [{ accounts }, { activities }, [assetProfile], dividends] =
await Promise.all([
@ -95,7 +95,7 @@ export class ImportService {
filters,
userCurrency,
userId,
startDate: parseDate(firstBuyDate)
startDate: parseDate(dateOfFirstActivity)
}),
this.symbolProfileService.getSymbolProfiles([
{
@ -106,7 +106,7 @@ export class ImportService {
await this.dataProviderService.getDividends({
dataSource,
symbol,
from: parseDate(firstBuyDate),
from: parseDate(dateOfFirstActivity),
granularity: 'day',
to: new Date()
})

1
apps/api/src/app/portfolio/portfolio.service.ts

@ -923,6 +923,7 @@ export class PortfolioService {
activitiesCount: transactionCount,
averagePrice: averagePrice.toNumber(),
dataProviderInfo: portfolioCalculator.getDataProviderInfos()?.[0],
dateOfFirstActivity: firstBuyDate,
dividendInBaseCurrency: dividendInBaseCurrency.toNumber(),
dividendYieldPercent: dividendYieldPercent.toNumber(),
dividendYieldPercentWithCurrencyEffect:

14
apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts

@ -116,11 +116,11 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit {
};
public dataProviderInfo: DataProviderInfo;
public dataSource: MatTableDataSource<Activity>;
public dateOfFirstActivity: string;
public dividendInBaseCurrency: number;
public dividendInBaseCurrencyPrecision = 2;
public dividendYieldPercentWithCurrencyEffect: number;
public feeInBaseCurrency: number;
public firstBuyDate: string;
public hasPermissionToCreateOwnTag: boolean;
public hasPermissionToReadMarketDataOfOwnAssetProfile: boolean;
public historicalDataItems: LineChartItem[];
@ -267,10 +267,10 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit {
activitiesCount,
averagePrice,
dataProviderInfo,
dateOfFirstActivity,
dividendInBaseCurrency,
dividendYieldPercentWithCurrencyEffect,
feeInBaseCurrency,
firstBuyDate,
historicalData,
investmentInBaseCurrencyWithCurrencyEffect,
marketPrice,
@ -298,6 +298,7 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit {
this.benchmarkDataItems = [];
this.countries = {};
this.dataProviderInfo = dataProviderInfo;
this.dateOfFirstActivity = dateOfFirstActivity;
this.dividendInBaseCurrency = dividendInBaseCurrency;
if (
@ -312,7 +313,6 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit {
dividendYieldPercentWithCurrencyEffect;
this.feeInBaseCurrency = feeInBaseCurrency;
this.firstBuyDate = firstBuyDate;
this.hasPermissionToReadMarketDataOfOwnAssetProfile =
hasPermission(
@ -461,16 +461,16 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit {
}
}
if (isToday(parseISO(this.firstBuyDate))) {
if (isToday(parseISO(this.dateOfFirstActivity))) {
// Add average price
this.historicalDataItems.push({
date: this.firstBuyDate,
date: this.dateOfFirstActivity,
value: this.averagePrice
});
// Add benchmark 1
this.benchmarkDataItems.push({
date: this.firstBuyDate,
date: this.dateOfFirstActivity,
value: averagePrice
});
@ -501,7 +501,7 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit {
if (
this.benchmarkDataItems[0]?.value === undefined &&
isSameMonth(parseISO(this.firstBuyDate), new Date())
isSameMonth(parseISO(this.dateOfFirstActivity), new Date())
) {
this.benchmarkDataItems[0].value = this.averagePrice;
}

4
apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html

@ -215,7 +215,7 @@
[deviceType]="data.deviceType"
[isDate]="true"
[locale]="data.locale"
[value]="firstBuyDate"
[value]="dateOfFirstActivity"
>First Activity</gf-value
>
</div>
@ -400,7 +400,7 @@
<gf-historical-market-data-editor
[currency]="SymbolProfile?.currency"
[dataSource]="SymbolProfile?.dataSource"
[dateOfFirstActivity]="firstBuyDate"
[dateOfFirstActivity]="dateOfFirstActivity"
[locale]="data.locale"
[marketData]="marketDataItems"
[symbol]="SymbolProfile?.symbol"

4
libs/common/src/lib/interfaces/responses/portfolio-holding-response.interface.ts

@ -11,11 +11,15 @@ export interface PortfolioHoldingResponse {
activitiesCount: number;
averagePrice: number;
dataProviderInfo: DataProviderInfo;
dateOfFirstActivity: string;
dividendInBaseCurrency: number;
dividendYieldPercent: number;
dividendYieldPercentWithCurrencyEffect: number;
feeInBaseCurrency: number;
/** @deprecated use dateOfFirstActivity */
firstBuyDate: string;
grossPerformance: number;
grossPerformancePercent: number;
grossPerformancePercentWithCurrencyEffect: number;

8
package-lock.json

@ -56,7 +56,7 @@
"class-validator": "0.14.3",
"color": "5.0.3",
"countries-and-timezones": "3.8.0",
"countries-list": "3.2.0",
"countries-list": "3.2.2",
"countup.js": "2.9.0",
"date-fns": "4.1.0",
"dotenv": "17.2.3",
@ -16319,9 +16319,9 @@
}
},
"node_modules/countries-list": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/countries-list/-/countries-list-3.2.0.tgz",
"integrity": "sha512-HYHAo2fwEsG3TmbsNdVmIQPHizRlqeYMTtLEAl0IANG/3jRYX7p3NR6VapDqKP0n60TmsRy1dyRjVN5JbywDbA==",
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/countries-list/-/countries-list-3.2.2.tgz",
"integrity": "sha512-ABJ/RWQBrPWy+hRuZoW+0ooK8p65Eo3WmUZwHm6v4wmfSPznNAKzjy3+UUYrJK2v3182BVsgWxdB6ROidj39kw==",
"license": "MIT"
},
"node_modules/countup.js": {

2
package.json

@ -100,7 +100,7 @@
"class-validator": "0.14.3",
"color": "5.0.3",
"countries-and-timezones": "3.8.0",
"countries-list": "3.2.0",
"countries-list": "3.2.2",
"countup.js": "2.9.0",
"date-fns": "4.1.0",
"dotenv": "17.2.3",

Loading…
Cancel
Save