Browse Source

Merge branch 'main' into task/upgrade-prisma-to-version-7.10.1

pull/8444/head
Thomas Kaul 2 weeks ago
committed by GitHub
parent
commit
479fa0601e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      CHANGELOG.md
  2. 8
      apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts
  3. 8
      apps/api/src/services/data-provider/data-provider.service.ts
  4. 16
      apps/api/src/services/data-provider/eod-historical-data/eod-historical-data.service.ts
  5. 17
      apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts
  6. 4
      apps/api/src/services/data-provider/ghostfolio/ghostfolio.service.ts
  7. 6
      apps/api/src/services/data-provider/google-sheets/google-sheets.service.ts
  8. 4
      apps/api/src/services/data-provider/interfaces/data-provider.interface.ts
  9. 23
      apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts
  10. 6
      libs/common/src/lib/interfaces/lookup-item.interface.ts
  11. 2
      libs/common/src/lib/interfaces/responses/data-provider-response.interface.ts
  12. 4
      libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts

4
CHANGELOG.md

@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Upgraded `prisma` from version `7.10.0` to `7.10.1`
### Fixed
- Fixed the duplicate data point of today in the chart of the holding detail dialog
## 3.100.0 - 2026-11-15
### Changed

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

@ -321,11 +321,11 @@ export class YahooFinanceDataEnhancerService implements DataEnhancerInterface {
quoteType?: string;
shortName?: string | null;
}): {
assetClass: AssetClass;
assetSubClass: AssetSubClass;
assetClass: AssetClass | undefined;
assetSubClass: AssetSubClass | undefined;
} {
let assetClass: AssetClass;
let assetSubClass: AssetSubClass;
let assetClass: AssetClass | undefined;
let assetSubClass: AssetSubClass | undefined;
switch (quoteType?.toLowerCase()) {
case 'cryptocurrency':

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

@ -74,6 +74,10 @@ export class DataProviderService implements OnModuleInit {
const dataProvider = this.getDataProvider(dataSource);
const symbol = dataProvider.getTestSymbol();
if (!symbol) {
return false;
}
const quotes = await this.getQuotes({
items: [
{
@ -963,7 +967,9 @@ export class DataProviderService implements OnModuleInit {
return lookupItem;
})
.sort(({ name: name1 }, { name: name2 }) => {
return name1?.toLowerCase().localeCompare(name2?.toLowerCase());
return (name1?.toLowerCase() ?? '').localeCompare(
name2?.toLowerCase() ?? ''
);
});
return {

16
apps/api/src/services/data-provider/eod-historical-data/eod-historical-data.service.ts

@ -59,7 +59,7 @@ export class EodHistoricalDataService
public async getAssetProfile({
requestTimeout = this.configurationService.get('REQUEST_TIMEOUT'),
symbol
}: GetAssetProfileParams): Promise<Partial<SymbolProfile>> {
}: GetAssetProfileParams): Promise<Partial<SymbolProfile> | undefined> {
const [searchResult] = await this.getSearchResult({
requestTimeout,
query: symbol
@ -249,7 +249,7 @@ export class EodHistoricalDataService
);
for (const { close, code, previousClose, timestamp } of quotes) {
let currency: string;
let currency: string | undefined;
if (this.isForex(code)) {
currency = this.convertFromEodSymbol(code)?.replace(
@ -409,8 +409,8 @@ export class EodHistoricalDataService
requestTimeout?: number;
}) {
let searchResult: (LookupItem & {
assetClass: AssetClass;
assetSubClass: AssetSubClass;
assetClass: AssetClass | undefined;
assetSubClass: AssetSubClass | undefined;
isin: string;
})[] = [];
@ -469,11 +469,11 @@ export class EodHistoricalDataService
Exchange: string;
Type: string;
}): {
assetClass: AssetClass;
assetSubClass: AssetSubClass;
assetClass: AssetClass | undefined;
assetSubClass: AssetSubClass | undefined;
} {
let assetClass: AssetClass;
let assetSubClass: AssetSubClass;
let assetClass: AssetClass | undefined;
let assetSubClass: AssetSubClass | undefined;
switch (Type?.toLowerCase()) {
case 'common stock':

17
apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts

@ -91,8 +91,8 @@ export class FinancialModelingPrepService
public async getAssetProfile({
requestTimeout = this.configurationService.get('REQUEST_TIMEOUT'),
symbol
}: GetAssetProfileParams): Promise<Partial<SymbolProfile>> {
let response: Partial<SymbolProfile> = {
}: GetAssetProfileParams): Promise<Partial<SymbolProfile> | undefined> {
let response: Partial<SymbolProfile> | undefined = {
symbol,
dataSource: this.getName()
};
@ -387,10 +387,13 @@ export class FinancialModelingPrepService
.then((res) => res.json());
for (const { close, date } of historical) {
const parsedDate = parseDate(date);
if (
(isSameDay(parseDate(date), currentFrom) ||
isAfter(parseDate(date), currentFrom)) &&
isBefore(parseDate(date), currentTo)
parsedDate &&
(isSameDay(parsedDate, currentFrom) ||
isAfter(parsedDate, currentFrom)) &&
isBefore(parsedDate, currentTo)
) {
result[date] = {
marketPrice: close
@ -512,7 +515,7 @@ export class FinancialModelingPrepService
marketState,
currency: currencyBySymbolMap[symbol]?.currency,
dataProviderInfo: this.getDataProviderInfo(),
dataSource: this.getDataProviderInfo().dataSource,
dataSource: this.getName(),
marketPrice: price
};
}
@ -679,7 +682,7 @@ export class FinancialModelingPrepService
}: {
requestTimeout: number;
symbol: string;
}): Promise<Pick<SymbolProfile, 'currency' | 'name'>> {
}): Promise<Pick<SymbolProfile, 'currency' | 'name'> | undefined> {
const results = await this.getSearchResults({
requestTimeout,
endpoint: 'search-symbol',

4
apps/api/src/services/data-provider/ghostfolio/ghostfolio.service.ts

@ -55,8 +55,8 @@ export class GhostfolioService implements DataProviderInterface {
public async getAssetProfile({
requestTimeout = this.configurationService.get('REQUEST_TIMEOUT'),
symbol
}: GetAssetProfileParams): Promise<Partial<SymbolProfile>> {
let assetProfile: DataProviderGhostfolioAssetProfileResponse;
}: GetAssetProfileParams): Promise<Partial<SymbolProfile> | undefined> {
let assetProfile: DataProviderGhostfolioAssetProfileResponse | undefined;
try {
const response = await this.fetchService.fetch(

6
apps/api/src/services/data-provider/google-sheets/google-sheets.service.ts

@ -37,7 +37,7 @@ export class GoogleSheetsService implements DataProviderInterface {
}
public async getAssetProfile({}: GetAssetProfileParams): Promise<
Partial<SymbolProfile>
Partial<SymbolProfile> | undefined
> {
return undefined;
}
@ -82,7 +82,9 @@ export class GoogleSheetsService implements DataProviderInterface {
const date = parseDate(row._rawData[0]);
const close = parseFloat(row._rawData[1]);
historicalData[format(date, DATE_FORMAT)] = { marketPrice: close };
if (date) {
historicalData[format(date, DATE_FORMAT)] = { marketPrice: close };
}
});
return historicalData;

4
apps/api/src/services/data-provider/interfaces/data-provider.interface.ts

@ -14,7 +14,7 @@ export interface DataProviderInterface {
getAssetProfile({
symbol
}: GetAssetProfileParams): Promise<Partial<SymbolProfile>>;
}: GetAssetProfileParams): Promise<Partial<SymbolProfile> | undefined>;
getDataProviderInfo(): DataProviderInfo;
@ -52,7 +52,7 @@ export interface DataProviderInterface {
symbols
}: GetQuotesParams): Promise<{ [symbol: string]: DataProviderResponse }>;
getTestSymbol(): string;
getTestSymbol(): string | undefined;
search({ includeIndices, query }: GetSearchParams): Promise<LookupResponse>;
}

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

@ -70,7 +70,14 @@ import { MatTabsModule } from '@angular/material/tabs';
import { NavigationStart, Router, RouterModule } from '@angular/router';
import { IonIcon } from '@ionic/angular/standalone';
import { isUUID } from 'class-validator';
import { format, isSameMonth, isToday, parseISO } from 'date-fns';
import {
format,
isBefore,
isSameMonth,
isToday,
parseISO,
startOfToday
} from 'date-fns';
import { addIcons } from 'ionicons';
import {
arrowDownCircleOutline,
@ -374,8 +381,15 @@ export class GfHoldingDetailDialogComponent implements OnInit {
permissions.readMarketDataOfOwnAssetProfile
);
this.historicalDataItems = historicalData.map(
({ averagePrice, date, marketPrice }) => {
const today = startOfToday();
this.historicalDataItems = historicalData
.filter(({ date }) => {
// Skip the market data from today on, the market price is added
// as the latest data point below
return isBefore(parseISO(date), today);
})
.map(({ averagePrice, date, marketPrice }) => {
this.benchmarkDataItems.push({
date,
value: isNumber(averagePrice) ? averagePrice : null
@ -385,8 +399,7 @@ export class GfHoldingDetailDialogComponent implements OnInit {
date,
value: marketPrice ?? 0
};
}
);
});
this.investmentInBaseCurrencyWithCurrencyEffect =
investmentInBaseCurrencyWithCurrencyEffect;

6
libs/common/src/lib/interfaces/lookup-item.interface.ts

@ -7,11 +7,11 @@ import {
import { DataProviderInfo } from './data-provider-info.interface';
export interface LookupItem {
assetClass: AssetClass;
assetSubClass: AssetSubClass;
assetClass?: AssetClass | null;
assetSubClass?: AssetSubClass | null;
currency: string;
dataProviderInfo: DataProviderInfo;
dataSource: DataSource | null;
name: string;
name?: string | null;
symbol: string;
}

2
libs/common/src/lib/interfaces/responses/data-provider-response.interface.ts

@ -7,7 +7,7 @@ export interface DataProviderHistoricalResponse {
}
export interface DataProviderResponse {
currency: string;
currency?: string;
dataProviderInfo?: DataProviderInfo;
dataSource: DataSource;
marketPrice: number;

4
libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts

@ -158,7 +158,7 @@ export class GfSymbolAutocompleteComponent
this.lookupItems = filteredLookupItems.map((lookupItem) => {
return {
...lookupItem,
assetSubClassString: translate(lookupItem.assetSubClass)
assetSubClassString: translate(lookupItem.assetSubClass ?? '')
};
});
@ -207,7 +207,7 @@ export class GfSymbolAutocompleteComponent
this.lookupItems = this.defaultLookupItems.map((lookupItem) => {
return {
...lookupItem,
assetSubClassString: translate(lookupItem.assetSubClass)
assetSubClassString: translate(lookupItem.assetSubClass ?? '')
};
});

Loading…
Cancel
Save