|
|
|
@ -309,24 +309,17 @@ export class DataGatheringService {
|
|
|
|
|
private async getSymbols7D(): Promise<IDataGatheringItem[]> {
|
|
|
|
|
const startDate = subDays(resetHours(new Date()), 7);
|
|
|
|
|
|
|
|
|
|
const distinctOrders = await this.prismaService.order.findMany({
|
|
|
|
|
distinct: ['symbol'],
|
|
|
|
|
const symbolProfilesToGather = (
|
|
|
|
|
await this.prismaService.symbolProfile.findMany({
|
|
|
|
|
orderBy: [{ symbol: 'asc' }],
|
|
|
|
|
select: { dataSource: true, symbol: true },
|
|
|
|
|
where: {
|
|
|
|
|
date: {
|
|
|
|
|
lt: endOfToday() // no draft
|
|
|
|
|
select: {
|
|
|
|
|
dataSource: true,
|
|
|
|
|
symbol: true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const distinctOrdersWithDate: IDataGatheringItem[] = distinctOrders
|
|
|
|
|
.filter((distinctOrder) => {
|
|
|
|
|
return !isGhostfolioScraperApiSymbol(distinctOrder.symbol);
|
|
|
|
|
})
|
|
|
|
|
.map((distinctOrder) => {
|
|
|
|
|
).map((symbolProfile) => {
|
|
|
|
|
return {
|
|
|
|
|
...distinctOrder,
|
|
|
|
|
...symbolProfile,
|
|
|
|
|
date: startDate
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
@ -348,7 +341,7 @@ export class DataGatheringService {
|
|
|
|
|
...this.getBenchmarksToGather(startDate),
|
|
|
|
|
...customSymbolsToGather,
|
|
|
|
|
...currencyPairsToGather,
|
|
|
|
|
...distinctOrdersWithDate
|
|
|
|
|
...symbolProfilesToGather
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -368,14 +361,12 @@ export class DataGatheringService {
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const distinctOrders = await this.prismaService.order.findMany({
|
|
|
|
|
distinct: ['symbol'],
|
|
|
|
|
orderBy: [{ date: 'asc' }],
|
|
|
|
|
select: { dataSource: true, date: true, symbol: true },
|
|
|
|
|
where: {
|
|
|
|
|
date: {
|
|
|
|
|
lt: endOfToday() // no draft
|
|
|
|
|
}
|
|
|
|
|
const symbolProfilesToGather =
|
|
|
|
|
await this.prismaService.symbolProfile.findMany({
|
|
|
|
|
orderBy: [{ symbol: 'asc' }],
|
|
|
|
|
select: {
|
|
|
|
|
dataSource: true,
|
|
|
|
|
symbol: true
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -383,7 +374,7 @@ export class DataGatheringService {
|
|
|
|
|
...this.getBenchmarksToGather(startDate),
|
|
|
|
|
...customSymbolsToGather,
|
|
|
|
|
...currencyPairsToGather,
|
|
|
|
|
...distinctOrders
|
|
|
|
|
...symbolProfilesToGather
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|