Browse Source
Feature/add data provider info to asset profile details dialog (#3434)
* Add data provider info to asset profile details dialog
* Update changelog
pull/3445/head^2
Thomas Kaul
8 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with
53 additions and
12 deletions
-
CHANGELOG.md
-
apps/api/src/app/admin/admin.service.ts
-
apps/api/src/services/data-provider/alpha-vantage/alpha-vantage.service.ts
-
apps/api/src/services/data-provider/data-provider.service.ts
-
apps/api/src/services/data-provider/eod-historical-data/eod-historical-data.service.ts
-
apps/api/src/services/data-provider/google-sheets/google-sheets.service.ts
-
apps/api/src/services/data-provider/rapid-api/rapid-api.service.ts
-
apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts
-
apps/api/src/services/symbol-profile/symbol-profile.service.ts
-
apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html
-
libs/common/src/lib/interfaces/enhanced-symbol-profile.interface.ts
|
|
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
|
|
|
|
## Unreleased |
|
|
|
|
|
|
|
### Added |
|
|
|
|
|
|
|
- Added the data provider information to the asset profile details dialog of the admin control |
|
|
|
|
|
|
|
### Fixed |
|
|
|
|
|
|
|
- Fixed an issue with the initial annual interest rate in the _FIRE_ calculator |
|
|
|
|
|
@ -313,6 +313,12 @@ export class AdminService { |
|
|
|
}) |
|
|
|
]); |
|
|
|
|
|
|
|
if (assetProfile) { |
|
|
|
assetProfile.dataProviderInfo = this.dataProviderService |
|
|
|
.getDataProvider(assetProfile.dataSource) |
|
|
|
.getDataProviderInfo(); |
|
|
|
} |
|
|
|
|
|
|
|
return { |
|
|
|
marketData, |
|
|
|
assetProfile: assetProfile ?? { |
|
|
|
|
|
@ -50,7 +50,9 @@ export class AlphaVantageService implements DataProviderInterface { |
|
|
|
|
|
|
|
public getDataProviderInfo(): DataProviderInfo { |
|
|
|
return { |
|
|
|
isPremium: false |
|
|
|
isPremium: false, |
|
|
|
name: 'Alpha Vantage', |
|
|
|
url: 'https://www.alphavantage.co' |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -598,10 +598,14 @@ export class DataProviderService { |
|
|
|
return name1?.toLowerCase().localeCompare(name2?.toLowerCase()); |
|
|
|
}) |
|
|
|
.map((lookupItem) => { |
|
|
|
if ( |
|
|
|
!this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION') || |
|
|
|
user.subscription.type === 'Premium' |
|
|
|
) { |
|
|
|
if (this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION')) { |
|
|
|
if (user.subscription.type === 'Premium') { |
|
|
|
lookupItem.dataProviderInfo.isPremium = false; |
|
|
|
} |
|
|
|
|
|
|
|
lookupItem.dataProviderInfo.name = undefined; |
|
|
|
lookupItem.dataProviderInfo.url = undefined; |
|
|
|
} else { |
|
|
|
lookupItem.dataProviderInfo.isPremium = false; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -66,7 +66,9 @@ export class EodHistoricalDataService implements DataProviderInterface { |
|
|
|
|
|
|
|
public getDataProviderInfo(): DataProviderInfo { |
|
|
|
return { |
|
|
|
isPremium: true |
|
|
|
isPremium: true, |
|
|
|
name: 'EOD Historical Data', |
|
|
|
url: 'https://eodhd.com' |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -46,7 +46,9 @@ export class GoogleSheetsService implements DataProviderInterface { |
|
|
|
|
|
|
|
public getDataProviderInfo(): DataProviderInfo { |
|
|
|
return { |
|
|
|
isPremium: false |
|
|
|
isPremium: false, |
|
|
|
name: 'Google Sheets', |
|
|
|
url: 'https://docs.google.com/spreadsheets' |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -43,7 +43,9 @@ export class RapidApiService implements DataProviderInterface { |
|
|
|
|
|
|
|
public getDataProviderInfo(): DataProviderInfo { |
|
|
|
return { |
|
|
|
isPremium: false |
|
|
|
isPremium: false, |
|
|
|
name: 'Rapid API', |
|
|
|
url: 'https://rapidapi.com' |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -43,7 +43,9 @@ export class YahooFinanceService implements DataProviderInterface { |
|
|
|
|
|
|
|
public getDataProviderInfo(): DataProviderInfo { |
|
|
|
return { |
|
|
|
isPremium: false |
|
|
|
isPremium: false, |
|
|
|
name: 'Yahoo Finance', |
|
|
|
url: 'https://finance.yahoo.com' |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -61,7 +61,9 @@ export class SymbolProfileService { |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
.then((symbolProfiles) => this.getSymbols(symbolProfiles)); |
|
|
|
.then((symbolProfiles) => { |
|
|
|
return this.enhanceSymbolProfiles(symbolProfiles); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public async getSymbolProfilesByIds( |
|
|
@ -83,7 +85,9 @@ export class SymbolProfileService { |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
.then((symbolProfiles) => this.getSymbols(symbolProfiles)); |
|
|
|
.then((symbolProfiles) => { |
|
|
|
return this.enhanceSymbolProfiles(symbolProfiles); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public updateSymbolProfile({ |
|
|
@ -119,7 +123,7 @@ export class SymbolProfileService { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private getSymbols( |
|
|
|
private enhanceSymbolProfiles( |
|
|
|
symbolProfiles: (SymbolProfile & { |
|
|
|
_count: { Order: number }; |
|
|
|
Order?: { |
|
|
|
|
|
@ -115,11 +115,22 @@ |
|
|
|
>Symbol</gf-value |
|
|
|
> |
|
|
|
</div> |
|
|
|
<div class="col-6 mb-3"> |
|
|
|
<gf-value |
|
|
|
i18n |
|
|
|
size="medium" |
|
|
|
[value]=" |
|
|
|
assetProfile?.dataProviderInfo?.name ?? assetProfile?.dataSource |
|
|
|
" |
|
|
|
>Data Source</gf-value |
|
|
|
> |
|
|
|
</div> |
|
|
|
<div class="col-6 mb-3"> |
|
|
|
<gf-value i18n size="medium" [value]="assetProfile?.currency" |
|
|
|
>Currency</gf-value |
|
|
|
> |
|
|
|
</div> |
|
|
|
<div class="col-6 mb-3"></div> |
|
|
|
<div class="col-6 mb-3"> |
|
|
|
<gf-value |
|
|
|
i18n |
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
import { AssetClass, AssetSubClass, DataSource } from '@prisma/client'; |
|
|
|
|
|
|
|
import { Country } from './country.interface'; |
|
|
|
import { DataProviderInfo } from './data-provider-info.interface'; |
|
|
|
import { ScraperConfiguration } from './scraper-configuration.interface'; |
|
|
|
import { Sector } from './sector.interface'; |
|
|
|
|
|
|
@ -12,6 +13,7 @@ export interface EnhancedSymbolProfile { |
|
|
|
countries: Country[]; |
|
|
|
createdAt: Date; |
|
|
|
currency?: string; |
|
|
|
dataProviderInfo?: DataProviderInfo; |
|
|
|
dataSource: DataSource; |
|
|
|
dateOfFirstActivity?: Date; |
|
|
|
id: string; |
|
|
|