Browse Source

Merge branch 'main' into task/upgrade-zone.js-to-version-0.16.3

pull/7862/head
Thomas Kaul 1 month ago
committed by GitHub
parent
commit
509497b316
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      CHANGELOG.md
  2. 7
      apps/api/src/app/portfolio/calculator/portfolio-calculator.factory.ts
  3. 8
      apps/api/src/app/portfolio/calculator/portfolio-calculator.ts
  4. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-buy.spec.ts
  5. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell-in-two-activities.spec.ts
  6. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell.spec.ts
  7. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy.spec.ts
  8. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btceur-in-base-currency-eur.spec.ts
  9. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btceur.spec.ts
  10. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts
  11. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-buy-before-first-market-price.spec.ts
  12. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-short.spec.ts
  13. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd.spec.ts
  14. 1
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-cash.spec.ts
  15. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-fee.spec.ts
  16. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-googl-buy.spec.ts
  17. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-jnug-buy-and-sell-and-buy-and-sell.spec.ts
  18. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-liability.spec.ts
  19. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-manual-buy-before-first-market-price.spec.ts
  20. 3
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-and-sell.spec.ts
  21. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-from-two-data-sources.spec.ts
  22. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-with-dividend.spec.ts
  23. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-no-activities.spec.ts
  24. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell-partially.spec.ts
  25. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell.spec.ts
  26. 3
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-stock-split.spec.ts
  27. 2
      apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-valuable.spec.ts
  28. 3
      apps/api/src/app/portfolio/current-rate.service.spec.ts
  29. 15
      apps/api/src/app/portfolio/current-rate.service.ts
  30. 2
      apps/api/src/app/portfolio/interfaces/get-values-params.interface.ts
  31. 12
      apps/api/src/app/portfolio/portfolio.service.ts
  32. 8
      apps/api/src/services/data-provider/data-provider.service.ts
  33. 382
      apps/client/src/locales/messages.ca.xlf
  34. 382
      apps/client/src/locales/messages.de.xlf
  35. 382
      apps/client/src/locales/messages.es.xlf
  36. 382
      apps/client/src/locales/messages.fr.xlf
  37. 382
      apps/client/src/locales/messages.it.xlf
  38. 382
      apps/client/src/locales/messages.ja.xlf
  39. 382
      apps/client/src/locales/messages.ko.xlf
  40. 382
      apps/client/src/locales/messages.nl.xlf
  41. 382
      apps/client/src/locales/messages.pl.xlf
  42. 382
      apps/client/src/locales/messages.pt.xlf
  43. 382
      apps/client/src/locales/messages.tr.xlf
  44. 382
      apps/client/src/locales/messages.uk.xlf
  45. 381
      apps/client/src/locales/messages.xlf
  46. 586
      apps/client/src/locales/messages.zh.xlf
  47. 18
      libs/ui/src/lib/no-activities-info/no-activities-info.component.html
  48. 8
      package-lock.json
  49. 2
      package.json

4
CHANGELOG.md

@ -14,7 +14,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Improved the style of the activity type filter on the activities page (experimental) - Improved the style of the activity type filter on the activities page (experimental)
- Improved the style of the no activities info component
- Improved the style of the selector in the benchmark comparator - Improved the style of the selector in the benchmark comparator
- Improved the language localization for Chinese (`zh`)
- Improved the language localization for German (`de`)
- Upgraded `papaparse` from version `5.5.3` to `5.7.0`
- Upgraded `zone.js` from version `0.16.2` to `0.16.3` - Upgraded `zone.js` from version `0.16.2` to `0.16.3`
## 3.69.0 - 2026-09-07 ## 3.69.0 - 2026-09-07

7
apps/api/src/app/portfolio/calculator/portfolio-calculator.factory.ts

@ -3,6 +3,7 @@ import { RedisCacheService } from '@ghostfolio/api/app/redis-cache/redis-cache.s
import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service'; import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service';
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service';
import { PortfolioSnapshotService } from '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service'; import { PortfolioSnapshotService } from '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service';
import { SubscriptionType } from '@ghostfolio/common/enums';
import { import {
Activity, Activity,
Filter, Filter,
@ -35,6 +36,7 @@ export class PortfolioCalculatorFactory {
currency, currency,
filters = [], filters = [],
usePortfolioSnapshotCache = true, usePortfolioSnapshotCache = true,
subscriptionType,
userId userId
}: { }: {
accountBalanceItems?: HistoricalDataItem[]; accountBalanceItems?: HistoricalDataItem[];
@ -43,6 +45,7 @@ export class PortfolioCalculatorFactory {
currency: string; currency: string;
filters?: Filter[]; filters?: Filter[];
usePortfolioSnapshotCache?: boolean; usePortfolioSnapshotCache?: boolean;
subscriptionType?: SubscriptionType;
userId: string; userId: string;
}): PortfolioCalculator { }): PortfolioCalculator {
switch (calculationType) { switch (calculationType) {
@ -53,6 +56,7 @@ export class PortfolioCalculatorFactory {
currency, currency,
filters, filters,
usePortfolioSnapshotCache, usePortfolioSnapshotCache,
subscriptionType,
userId, userId,
configurationService: this.configurationService, configurationService: this.configurationService,
currentRateService: this.currentRateService, currentRateService: this.currentRateService,
@ -68,6 +72,7 @@ export class PortfolioCalculatorFactory {
currency, currency,
filters, filters,
usePortfolioSnapshotCache, usePortfolioSnapshotCache,
subscriptionType,
userId, userId,
configurationService: this.configurationService, configurationService: this.configurationService,
currentRateService: this.currentRateService, currentRateService: this.currentRateService,
@ -83,6 +88,7 @@ export class PortfolioCalculatorFactory {
currency, currency,
filters, filters,
usePortfolioSnapshotCache, usePortfolioSnapshotCache,
subscriptionType,
userId, userId,
configurationService: this.configurationService, configurationService: this.configurationService,
currentRateService: this.currentRateService, currentRateService: this.currentRateService,
@ -98,6 +104,7 @@ export class PortfolioCalculatorFactory {
currency, currency,
filters, filters,
usePortfolioSnapshotCache, usePortfolioSnapshotCache,
subscriptionType,
userId, userId,
configurationService: this.configurationService, configurationService: this.configurationService,
currentRateService: this.currentRateService, currentRateService: this.currentRateService,

8
apps/api/src/app/portfolio/calculator/portfolio-calculator.ts

@ -20,6 +20,7 @@ import {
PORTFOLIO_SNAPSHOT_COMPUTATION_QUEUE_PRIORITY_HIGH, PORTFOLIO_SNAPSHOT_COMPUTATION_QUEUE_PRIORITY_HIGH,
PORTFOLIO_SNAPSHOT_COMPUTATION_QUEUE_PRIORITY_LOW PORTFOLIO_SNAPSHOT_COMPUTATION_QUEUE_PRIORITY_LOW
} from '@ghostfolio/common/config'; } from '@ghostfolio/common/config';
import { SubscriptionType } from '@ghostfolio/common/enums';
import { import {
DATE_FORMAT, DATE_FORMAT,
getAssetProfileIdentifier, getAssetProfileIdentifier,
@ -89,6 +90,7 @@ export abstract class PortfolioCalculator {
private snapshot: PortfolioSnapshot; private snapshot: PortfolioSnapshot;
private snapshotPromise: Promise<void>; private snapshotPromise: Promise<void>;
private startDate: Date; private startDate: Date;
private subscriptionType?: SubscriptionType;
private transactionPoints: TransactionPoint[]; private transactionPoints: TransactionPoint[];
private usePortfolioSnapshotCache: boolean; private usePortfolioSnapshotCache: boolean;
private userId: string; private userId: string;
@ -104,6 +106,7 @@ export abstract class PortfolioCalculator {
portfolioSnapshotService, portfolioSnapshotService,
redisCacheService, redisCacheService,
usePortfolioSnapshotCache = true, usePortfolioSnapshotCache = true,
subscriptionType,
userId userId
}: { }: {
accountBalanceItems: HistoricalDataItem[]; accountBalanceItems: HistoricalDataItem[];
@ -116,6 +119,7 @@ export abstract class PortfolioCalculator {
portfolioSnapshotService: PortfolioSnapshotService; portfolioSnapshotService: PortfolioSnapshotService;
redisCacheService: RedisCacheService; redisCacheService: RedisCacheService;
usePortfolioSnapshotCache?: boolean; usePortfolioSnapshotCache?: boolean;
subscriptionType?: SubscriptionType;
userId: string; userId: string;
}) { }) {
this.accountBalanceItems = accountBalanceItems; this.accountBalanceItems = accountBalanceItems;
@ -179,6 +183,7 @@ export abstract class PortfolioCalculator {
this.portfolioSnapshotService = portfolioSnapshotService; this.portfolioSnapshotService = portfolioSnapshotService;
this.redisCacheService = redisCacheService; this.redisCacheService = redisCacheService;
this.usePortfolioSnapshotCache = usePortfolioSnapshotCache; this.usePortfolioSnapshotCache = usePortfolioSnapshotCache;
this.subscriptionType = subscriptionType;
this.userId = userId; this.userId = userId;
const { endDate, startDate } = getIntervalFromDateRange({ const { endDate, startDate } = getIntervalFromDateRange({
@ -286,7 +291,8 @@ export abstract class PortfolioCalculator {
dateQuery: { dateQuery: {
gte: this.startDate, gte: this.startDate,
lt: this.endDate lt: this.endDate
} },
subscriptionType: this.subscriptionType
}); });
this.dataProviderInfos = dataProviderInfos; this.dataProviderInfos = dataProviderInfos;

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-buy.spec.ts

@ -59,7 +59,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell-in-two-activities.spec.ts

@ -59,7 +59,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy-and-sell.spec.ts

@ -59,7 +59,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-baln-buy.spec.ts

@ -59,7 +59,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btceur-in-base-currency-eur.spec.ts

@ -81,7 +81,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btceur.spec.ts

@ -69,7 +69,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts

@ -71,7 +71,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-buy-before-first-market-price.spec.ts

@ -57,7 +57,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd-short.spec.ts

@ -69,7 +69,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-btcusd.spec.ts

@ -69,7 +69,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

1
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-cash.spec.ts

@ -118,7 +118,6 @@ describe('PortfolioCalculator', () => {
currentRateService = new CurrentRateService( currentRateService = new CurrentRateService(
null, null,
dataProviderService, dataProviderService,
null,
null null
); );

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-fee.spec.ts

@ -59,7 +59,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-googl-buy.spec.ts

@ -71,7 +71,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-jnug-buy-and-sell-and-buy-and-sell.spec.ts

@ -72,7 +72,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-liability.spec.ts

@ -59,7 +59,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-manual-buy-before-first-market-price.spec.ts

@ -57,7 +57,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

3
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-and-sell.spec.ts

@ -56,7 +56,8 @@ describe('PortfolioCalculator', () => {
RedisCacheServiceMock.reset(); RedisCacheServiceMock.reset();
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-from-two-data-sources.spec.ts

@ -71,7 +71,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-msft-buy-with-dividend.spec.ts

@ -59,7 +59,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-no-activities.spec.ts

@ -54,7 +54,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell-partially.spec.ts

@ -72,7 +72,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-novn-buy-and-sell.spec.ts

@ -72,7 +72,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

3
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-stock-split.spec.ts

@ -60,7 +60,8 @@ describe('RoaiPortfolioCalculator stock splits', () => {
RedisCacheServiceMock.reset(); RedisCacheServiceMock.reset();
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,
null, null,

2
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-valuable.spec.ts

@ -59,7 +59,7 @@ describe('PortfolioCalculator', () => {
configurationService = new ConfigurationService(); configurationService = new ConfigurationService();
currentRateService = new CurrentRateService(null, null, null, null); currentRateService = new CurrentRateService(null, null, null);
exchangeRateDataService = new ExchangeRateDataService( exchangeRateDataService = new ExchangeRateDataService(
null, null,

3
apps/api/src/app/portfolio/current-rate.service.spec.ts

@ -119,8 +119,7 @@ describe('CurrentRateService', () => {
currentRateService = new CurrentRateService( currentRateService = new CurrentRateService(
null, null,
dataProviderService, dataProviderService,
marketDataService, marketDataService
null
); );
}); });

15
apps/api/src/app/portfolio/current-rate.service.ts

@ -11,10 +11,8 @@ import {
DataProviderInfo, DataProviderInfo,
ResponseError ResponseError
} from '@ghostfolio/common/interfaces'; } from '@ghostfolio/common/interfaces';
import type { RequestWithUser } from '@ghostfolio/common/types';
import { Inject, Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { REQUEST } from '@nestjs/core';
import { isBefore, isToday } from 'date-fns'; import { isBefore, isToday } from 'date-fns';
import { isEmpty, uniqBy } from 'lodash'; import { isEmpty, uniqBy } from 'lodash';
@ -29,15 +27,14 @@ export class CurrentRateService {
public constructor( public constructor(
private readonly activitiesService: ActivitiesService, private readonly activitiesService: ActivitiesService,
private readonly dataProviderService: DataProviderService, private readonly dataProviderService: DataProviderService,
private readonly marketDataService: MarketDataService, private readonly marketDataService: MarketDataService
@Inject(REQUEST) private readonly request: RequestWithUser
) {} ) {}
@LogPerformance @LogPerformance
// TODO: Pass user instead of using this.request.user
public async getValues({ public async getValues({
dataGatheringItems, dataGatheringItems,
dateQuery dateQuery,
subscriptionType
}: GetValuesParams): Promise<GetValuesObject> { }: GetValuesParams): Promise<GetValuesObject> {
const dataProviderInfos: DataProviderInfo[] = []; const dataProviderInfos: DataProviderInfo[] = [];
@ -52,8 +49,8 @@ export class CurrentRateService {
if (includesToday) { if (includesToday) {
const quotes = await this.dataProviderService.getQuotes({ const quotes = await this.dataProviderService.getQuotes({
items: dataGatheringItems, subscriptionType,
user: this.request?.user items: dataGatheringItems
}); });
for (const { dataSource, symbol } of dataGatheringItems) { for (const { dataSource, symbol } of dataGatheringItems) {

2
apps/api/src/app/portfolio/interfaces/get-values-params.interface.ts

@ -1,8 +1,10 @@
import { DataGatheringItem } from '@ghostfolio/api/services/interfaces/interfaces'; import { DataGatheringItem } from '@ghostfolio/api/services/interfaces/interfaces';
import { SubscriptionType } from '@ghostfolio/common/enums';
import { DateQuery } from './date-query.interface'; import { DateQuery } from './date-query.interface';
export interface GetValuesParams { export interface GetValuesParams {
dataGatheringItems: DataGatheringItem[]; dataGatheringItems: DataGatheringItem[];
dateQuery: DateQuery; dateQuery: DateQuery;
subscriptionType?: SubscriptionType;
} }

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

@ -546,7 +546,8 @@ export class PortfolioService {
filters, filters,
userId, userId,
calculationType: this.getUserPerformanceCalculationType(user), calculationType: this.getUserPerformanceCalculationType(user),
currency: userCurrency currency: userCurrency,
subscriptionType: user.subscription?.type
}); });
const { historicalData } = await portfolioCalculator.getSnapshot(); const { historicalData } = await portfolioCalculator.getSnapshot();
@ -633,7 +634,8 @@ export class PortfolioService {
userId, userId,
calculationType: this.getUserPerformanceCalculationType(user), calculationType: this.getUserPerformanceCalculationType(user),
currency: userCurrency, currency: userCurrency,
filters: portfolioSnapshotFilters filters: portfolioSnapshotFilters,
subscriptionType: user.subscription?.type
}); });
const { createdAt, currentValueInBaseCurrency, hasErrors, positions } = const { createdAt, currentValueInBaseCurrency, hasErrors, positions } =
@ -963,7 +965,8 @@ export class PortfolioService {
calculationType: this.getUserPerformanceCalculationType(user), calculationType: this.getUserPerformanceCalculationType(user),
currency: userCurrency, currency: userCurrency,
filters: isExcludedHolding ? holdingFilters : undefined, filters: isExcludedHolding ? holdingFilters : undefined,
usePortfolioSnapshotCache: !isExcludedHolding usePortfolioSnapshotCache: !isExcludedHolding,
subscriptionType: user.subscription?.type
}); });
const transactionPoints = portfolioCalculator.getTransactionPoints(); const transactionPoints = portfolioCalculator.getTransactionPoints();
@ -1218,7 +1221,8 @@ export class PortfolioService {
filters, filters,
userId, userId,
calculationType: this.getUserPerformanceCalculationType(user), calculationType: this.getUserPerformanceCalculationType(user),
currency: userCurrency currency: userCurrency,
subscriptionType: user.subscription?.type
}); });
const { errors, hasErrors, historicalData } = const { errors, hasErrors, historicalData } =

8
apps/api/src/services/data-provider/data-provider.service.ts

@ -594,13 +594,13 @@ export class DataProviderService implements OnModuleInit {
public async getQuotes({ public async getQuotes({
items, items,
requestTimeout, requestTimeout,
useCache = true, subscriptionType,
user useCache = true
}: { }: {
items: AssetProfileIdentifier[]; items: AssetProfileIdentifier[];
requestTimeout?: number; requestTimeout?: number;
subscriptionType?: SubscriptionType;
useCache?: boolean; useCache?: boolean;
user?: UserWithSettings;
}): Promise<{ }): Promise<{
[assetProfileIdentifier: string]: DataProviderResponse; [assetProfileIdentifier: string]: DataProviderResponse;
}> { }> {
@ -687,7 +687,7 @@ export class DataProviderService implements OnModuleInit {
} else if ( } else if (
dataProvider.getDataProviderInfo().isPremium && dataProvider.getDataProviderInfo().isPremium &&
this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION') && this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION') &&
user?.subscription?.type === SubscriptionType.Basic subscriptionType === SubscriptionType.Basic
) { ) {
// Skip symbols of Premium data providers for users without subscription // Skip symbols of Premium data providers for users without subscription
return false; return false;

382
apps/client/src/locales/messages.ca.xlf

File diff suppressed because it is too large

382
apps/client/src/locales/messages.de.xlf

File diff suppressed because it is too large

382
apps/client/src/locales/messages.es.xlf

File diff suppressed because it is too large

382
apps/client/src/locales/messages.fr.xlf

File diff suppressed because it is too large

382
apps/client/src/locales/messages.it.xlf

File diff suppressed because it is too large

382
apps/client/src/locales/messages.ja.xlf

File diff suppressed because it is too large

382
apps/client/src/locales/messages.ko.xlf

File diff suppressed because it is too large

382
apps/client/src/locales/messages.nl.xlf

File diff suppressed because it is too large

382
apps/client/src/locales/messages.pl.xlf

File diff suppressed because it is too large

382
apps/client/src/locales/messages.pt.xlf

File diff suppressed because it is too large

382
apps/client/src/locales/messages.tr.xlf

File diff suppressed because it is too large

382
apps/client/src/locales/messages.uk.xlf

File diff suppressed because it is too large

381
apps/client/src/locales/messages.xlf

File diff suppressed because it is too large

586
apps/client/src/locales/messages.zh.xlf

File diff suppressed because it is too large

18
libs/ui/src/lib/no-activities-info/no-activities-info.component.html

@ -2,12 +2,14 @@
<div class="d-flex justify-content-center mb-1"> <div class="d-flex justify-content-center mb-1">
<gf-logo size="large" [showLabel]="false" /> <gf-logo size="large" [showLabel]="false" />
</div> </div>
<a <div class="d-flex justify-content-center">
class="align-items-center justify-content-center" <a
color="primary" class="align-items-center d-inline-flex justify-content-center"
mat-button color="primary"
[routerLink]="routerLinkPortfolioActivitiesCreate" mat-button
> [routerLink]="routerLinkPortfolioActivitiesCreate"
<span i18n>Time to add your first activity.</span> >
</a> <span i18n>Add your first activity</span>
</a>
</div>
</div> </div>

8
package-lock.json

@ -90,7 +90,7 @@
"ngx-markdown": "22.0.0", "ngx-markdown": "22.0.0",
"ngx-skeleton-loader": "13.0.0", "ngx-skeleton-loader": "13.0.0",
"open-color": "1.9.1", "open-color": "1.9.1",
"papaparse": "5.5.3", "papaparse": "5.7.0",
"passport": "0.7.0", "passport": "0.7.0",
"passport-google-oauth20": "2.0.0", "passport-google-oauth20": "2.0.0",
"passport-headerapikey": "1.2.2", "passport-headerapikey": "1.2.2",
@ -29413,9 +29413,9 @@
"license": "BlueOak-1.0.0" "license": "BlueOak-1.0.0"
}, },
"node_modules/papaparse": { "node_modules/papaparse": {
"version": "5.5.3", "version": "5.7.0",
"resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.5.3.tgz", "resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.7.0.tgz",
"integrity": "sha512-5QvjGxYVjxO59MGU2lHVYpRWBBtKHnlIAcSe1uNFCkkptUh63NFRj0FJQm7nR67puEruUci/ZkjmEFrjCAyP4A==", "integrity": "sha512-qBGxg/7Q3Kl9Wfhrz2Z74UnvnHTXLNG6jmKJFeBvP2+y4lV7So+7SR62+Zd47JvdrCkX+nDcnr0ObPzek/+6RA==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/param-case": { "node_modules/param-case": {

2
package.json

@ -134,7 +134,7 @@
"ngx-markdown": "22.0.0", "ngx-markdown": "22.0.0",
"ngx-skeleton-loader": "13.0.0", "ngx-skeleton-loader": "13.0.0",
"open-color": "1.9.1", "open-color": "1.9.1",
"papaparse": "5.5.3", "papaparse": "5.7.0",
"passport": "0.7.0", "passport": "0.7.0",
"passport-google-oauth20": "2.0.0", "passport-google-oauth20": "2.0.0",
"passport-headerapikey": "1.2.2", "passport-headerapikey": "1.2.2",

Loading…
Cancel
Save