|
|
|
|
@ -23,7 +23,7 @@ import {
|
|
|
|
|
} from '@ghostfolio/common/interfaces';
|
|
|
|
|
import { MarketState } from '@ghostfolio/common/types';
|
|
|
|
|
|
|
|
|
|
import { Injectable, Logger } from '@nestjs/common';
|
|
|
|
|
import { Injectable, Logger, OnModuleInit } from '@nestjs/common';
|
|
|
|
|
import {
|
|
|
|
|
AssetClass,
|
|
|
|
|
AssetSubClass,
|
|
|
|
|
@ -44,7 +44,9 @@ import {
|
|
|
|
|
import { uniqBy } from 'lodash';
|
|
|
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
|
export class FinancialModelingPrepService implements DataProviderInterface {
|
|
|
|
|
export class FinancialModelingPrepService
|
|
|
|
|
implements DataProviderInterface, OnModuleInit
|
|
|
|
|
{
|
|
|
|
|
private static countriesMapping = {
|
|
|
|
|
'Korea (the Republic of)': 'South Korea',
|
|
|
|
|
'Russian Federation': 'Russia',
|
|
|
|
|
@ -57,7 +59,9 @@ export class FinancialModelingPrepService implements DataProviderInterface {
|
|
|
|
|
private readonly configurationService: ConfigurationService,
|
|
|
|
|
private readonly cryptocurrencyService: CryptocurrencyService,
|
|
|
|
|
private readonly prismaService: PrismaService
|
|
|
|
|
) {
|
|
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
public onModuleInit() {
|
|
|
|
|
this.apiKey = this.configurationService.get(
|
|
|
|
|
'API_KEY_FINANCIAL_MODELING_PREP'
|
|
|
|
|
);
|
|
|
|
|
|