Feature/add data provider info to asset profile details dialog (#3434)
* Add data provider info to asset profile details dialog * Update changelog
This commit is contained in:
parent
60ef46accf
commit
c009f8c12f
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user