Browse Source

Add url to symbol profile

pull/722/head
Thomas 3 years ago
parent
commit
2692c362fc
  1. 17
      apps/api/src/services/data-gathering.service.ts
  2. 9
      apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts
  3. 1
      prisma/schema.prisma

17
apps/api/src/services/data-gathering.service.ts

@ -220,9 +220,11 @@ export class DataGatheringService {
Logger.log('Profile data gathering has been started.');
console.time('data-gathering-profile');
let dataGatheringItems = aDataGatheringItems.filter((dataGatheringItem) => {
return dataGatheringItem.dataSource !== 'MANUAL';
});
let dataGatheringItems = aDataGatheringItems?.filter(
(dataGatheringItem) => {
return dataGatheringItem.dataSource !== 'MANUAL';
}
);
if (!dataGatheringItems) {
dataGatheringItems = await this.getSymbolsProfileData();
@ -260,7 +262,8 @@ export class DataGatheringService {
currency,
dataSource,
name,
sectors
sectors,
url
} = assetProfiles[symbol];
try {
@ -273,7 +276,8 @@ export class DataGatheringService {
dataSource,
name,
sectors,
symbol
symbol,
url
},
update: {
assetClass,
@ -281,7 +285,8 @@ export class DataGatheringService {
countries,
currency,
name,
sectors
sectors,
url
},
where: {
dataSource_symbol: {

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

@ -119,11 +119,10 @@ export class YahooFinanceService implements DataProviderInterface {
}
}
// TODO: Add url if available
/*const url = assetProfile.summaryProfile?.website;
if (url) {
response.url = url;
}*/
const url = assetProfile.summaryProfile?.website;
if (url) {
response.url = url;
}
} catch {}
return response;

1
prisma/schema.prisma

@ -129,6 +129,7 @@ model SymbolProfile {
sectors Json?
symbol String
symbolMapping Json?
url String?
@@unique([dataSource, symbol])
}

Loading…
Cancel
Save