|
@ -57,33 +57,34 @@ export class GhostfolioService { |
|
|
symbol |
|
|
symbol |
|
|
}) |
|
|
}) |
|
|
.then(async (assetProfile) => { |
|
|
.then(async (assetProfile) => { |
|
|
|
|
|
const dataSourceOrigin = DataSource.GHOSTFOLIO; |
|
|
|
|
|
|
|
|
if (assetProfile) { |
|
|
if (assetProfile) { |
|
|
await this.prismaService.dataProviderGhostfolioResolvedAssetProfile.upsert( |
|
|
await this.prismaService.resolvedAssetProfile.upsert({ |
|
|
{ |
|
|
create: { |
|
|
create: { |
|
|
dataSourceOrigin, |
|
|
symbol, |
|
|
symbol, |
|
|
currency: assetProfile.currency, |
|
|
currency: assetProfile.currency, |
|
|
dataSource: assetProfile.dataSource |
|
|
dataSourceTarget: assetProfile.dataSource |
|
|
}, |
|
|
}, |
|
|
update: { |
|
|
update: { |
|
|
requestCount: { |
|
|
requestCount: { |
|
|
increment: 1 |
|
|
increment: 1 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
where: { |
|
|
where: { |
|
|
dataSource_symbol: { |
|
|
dataSourceOrigin_symbol: { |
|
|
symbol, |
|
|
dataSourceOrigin, |
|
|
dataSource: assetProfile.dataSource |
|
|
symbol |
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
result = { |
|
|
result = { |
|
|
...result, |
|
|
...result, |
|
|
...assetProfile, |
|
|
...assetProfile, |
|
|
dataSource: DataSource.GHOSTFOLIO |
|
|
dataSource: dataSourceOrigin |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
return assetProfile; |
|
|
return assetProfile; |
|
|