Browse Source

Task/deprecate firstOrderDate in favor of dateOfFirstActivity in portfolio performance endpoint (#7429)

* Deprecate firstOrderDate in favor of dateOfFirstActivity in portfolio performance response

* Update changelog
pull/7430/head^2
Thomas Kaul 4 days ago
committed by GitHub
parent
commit
f4a133df4a
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      CHANGELOG.md
  2. 2
      apps/api/src/app/portfolio/portfolio.service.ts
  3. 8
      apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
  4. 6
      libs/common/src/lib/interfaces/responses/portfolio-performance-response.interface.ts
  5. 6
      libs/ui/src/lib/services/data.service.ts

6
CHANGELOG.md

@ -5,6 +5,12 @@ 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
### Changed
- Deprecated `firstOrderDate` in favor of `dateOfFirstActivity` in the `GET api/v2/portfolio/performance` endpoint
## 3.34.0 - 2026-07-25
### Changed

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

@ -1034,6 +1034,7 @@ export class PortfolioService {
if (accountBalanceItems.length === 0 && activities.length === 0) {
return {
chart: [],
dateOfFirstActivity: undefined,
firstOrderDate: undefined,
hasErrors: false,
performance: {
@ -1091,6 +1092,7 @@ export class PortfolioService {
chart,
errors,
hasErrors,
dateOfFirstActivity: parseDate(historicalData[0]?.date),
firstOrderDate: parseDate(historicalData[0]?.date),
performance: {
netPerformance,

8
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts

@ -110,7 +110,7 @@ export class GfAnalysisPageComponent implements OnInit {
private readonly deviceType = computed(
() => this.deviceDetectorService.deviceInfo().deviceType
);
private firstOrderDate: Date;
private dateOfFirstActivity: Date;
private readonly changeDetectorRef = inject(ChangeDetectorRef);
private readonly clipboard = inject(Clipboard);
@ -302,8 +302,8 @@ export class GfAnalysisPageComponent implements OnInit {
range: this.user?.settings?.dateRange ?? DEFAULT_DATE_RANGE
})
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(({ chart, firstOrderDate, performance }) => {
this.firstOrderDate = firstOrderDate ?? new Date();
.subscribe(({ chart, dateOfFirstActivity, performance }) => {
this.dateOfFirstActivity = dateOfFirstActivity ?? new Date();
this.investments = [];
this.performance = performance;
@ -416,7 +416,7 @@ export class GfAnalysisPageComponent implements OnInit {
symbol,
filters: this.userService.getFilters(),
range: this.user?.settings?.dateRange ?? DEFAULT_DATE_RANGE,
startDate: this.firstOrderDate
startDate: this.dateOfFirstActivity
})
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(({ marketData }) => {

6
libs/common/src/lib/interfaces/responses/portfolio-performance-response.interface.ts

@ -4,6 +4,12 @@ import { ResponseError } from './errors.interface';
export interface PortfolioPerformanceResponse extends ResponseError {
chart?: HistoricalDataItem[];
dateOfFirstActivity: Date;
/**
* @deprecated Use `dateOfFirstActivity` instead
*/
firstOrderDate: Date;
performance: PortfolioPerformance;
}

6
libs/ui/src/lib/services/data.service.ts

@ -716,8 +716,10 @@ export class DataService {
})
.pipe(
map((response) => {
if (response.firstOrderDate) {
response.firstOrderDate = parseISO(response.firstOrderDate);
if (response.dateOfFirstActivity) {
response.dateOfFirstActivity = parseISO(
response.dateOfFirstActivity
);
}
return response;

Loading…
Cancel
Save