Browse Source

Feature/eliminate firstOrderDate in favor of dateOfFirstActivity in portfolio summary component (#4462)

* Eliminate firstOrderDate in favor of dateOfFirstActivity in portfolio summary component

* Update changelog
pull/4471/head
Sayed Murtadha Ahmed 3 weeks ago
committed by GitHub
parent
commit
6c624fefc9
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 1
      apps/api/src/app/portfolio/portfolio.service.ts
  3. 2
      apps/api/src/helper/object.helper.spec.ts
  4. 4
      apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts
  5. 6
      apps/client/src/app/services/data.service.ts
  6. 1
      libs/common/src/lib/interfaces/portfolio-summary.interface.ts

1
CHANGELOG.md

@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved the export functionality by applying filters on accounts and tags
- Improved the symbol validation in the _Yahoo Finance_ service (get asset profiles)
- Eliminated `firstOrderDate` from the summary of the portfolio details endpoint in favor of using `dateOfFirstActivity` from the user endpoint
- Refactored `lodash.uniq` with `Array.from(new Set(...))`
- Refreshed the cryptocurrencies list
- Improved the language localization for Turkish (`tr`)

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

@ -1918,7 +1918,6 @@ export class PortfolioService {
annualizedPerformancePercentWithCurrencyEffect,
cash,
excludedAccountsAndActivities,
firstOrderDate,
netPerformance,
netPerformancePercentage,
netPerformancePercentageWithCurrencyEffect,

2
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,

4
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 {

6
apps/client/src/app/services/data.service.ts

@ -529,12 +529,6 @@ export class DataService {
})
.pipe(
map((response) => {
if (response.summary?.firstOrderDate) {
response.summary.firstOrderDate = parseISO(
response.summary.firstOrderDate
);
}
if (response.holdings) {
for (const symbol of Object.keys(response.holdings)) {
response.holdings[symbol].assetClassLabel = translate(

1
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;

Loading…
Cancel
Save