From 7e31396e259f8ab7a4990f986529819137c125e5 Mon Sep 17 00:00:00 2001 From: Sayed Murtadha Ahmed Date: Wed, 19 Mar 2025 15:35:24 +0300 Subject: [PATCH] (gh-4459): Eliminate firstOrderDate in favor of dateOfFirstActivity in PortfolioSummaryComponent --- apps/api/src/app/portfolio/portfolio.service.ts | 1 - apps/api/src/helper/object.helper.spec.ts | 2 -- .../portfolio-summary/portfolio-summary.component.ts | 4 ++-- libs/common/src/lib/interfaces/portfolio-summary.interface.ts | 1 - 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index e90ebd4ae..93f3fd213 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -1918,7 +1918,6 @@ export class PortfolioService { annualizedPerformancePercentWithCurrencyEffect, cash, excludedAccountsAndActivities, - firstOrderDate, netPerformance, netPerformancePercentage, netPerformancePercentageWithCurrencyEffect, diff --git a/apps/api/src/helper/object.helper.spec.ts b/apps/api/src/helper/object.helper.spec.ts index 85fb8f4eb..b0370fa3f 100644 --- a/apps/api/src/helper/object.helper.spec.ts +++ b/apps/api/src/helper/object.helper.spec.ts @@ -1519,7 +1519,6 @@ describe('redactAttributes', () => { annualizedPerformancePercentWithCurrencyEffect: 0.1694019484552876, cash: null, excludedAccountsAndActivities: null, - firstOrderDate: '2017-01-02T23:00:00.000Z', netPerformance: null, netPerformancePercentage: 2.3039314216696174, netPerformancePercentageWithCurrencyEffect: 2.3589806001456606, @@ -3023,7 +3022,6 @@ describe('redactAttributes', () => { annualizedPerformancePercentWithCurrencyEffect: 0.1694019484552876, cash: null, excludedAccountsAndActivities: null, - firstOrderDate: '2017-01-02T23:00:00.000Z', netPerformance: null, netPerformancePercentage: 2.3039314216696174, netPerformancePercentageWithCurrencyEffect: 2.3589806001456606, diff --git a/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts b/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts index 25f7d9307..a44eacc93 100644 --- a/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts +++ b/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts @@ -40,8 +40,8 @@ export class PortfolioSummaryComponent implements OnChanges { public ngOnChanges() { if (this.summary) { - if (this.summary.firstOrderDate) { - this.timeInMarket = formatDistanceToNow(this.summary.firstOrderDate, { + if (this.user.dateOfFirstActivity) { + this.timeInMarket = formatDistanceToNow(this.user.dateOfFirstActivity, { locale: getDateFnsLocale(this.language) }); } else { diff --git a/libs/common/src/lib/interfaces/portfolio-summary.interface.ts b/libs/common/src/lib/interfaces/portfolio-summary.interface.ts index 5b27f4c7e..42496b228 100644 --- a/libs/common/src/lib/interfaces/portfolio-summary.interface.ts +++ b/libs/common/src/lib/interfaces/portfolio-summary.interface.ts @@ -16,7 +16,6 @@ export interface PortfolioSummary extends PortfolioPerformance { filteredValueInBaseCurrency?: number; filteredValueInPercentage?: number; fireWealth: number; - firstOrderDate: Date; grossPerformance: number; grossPerformanceWithCurrencyEffect: number; interest: number;