Browse Source

Fix data gathering of manual activities

pull/7997/head
Thomas Kaul 2 weeks ago
parent
commit
3e81e36d94
  1. 13
      apps/api/src/app/activities/activities.controller.ts
  2. 2
      apps/api/src/app/activities/activities.service.ts

13
apps/api/src/app/activities/activities.controller.ts

@ -284,15 +284,18 @@ export class ActivitiesController {
user: { connect: { id: userId } }
});
if (dataSource && !isActivityInFuture({ date: activity.date })) {
// Gather symbol data in the background, if data source is set
// (not MANUAL) and the date is not in the future
if (
activity.SymbolProfile.dataSource !== 'MANUAL' &&
!isActivityInFuture({ date: activity.date })
) {
// Gather symbol data in the background, if the data source is not
// MANUAL and the date is not in the future
this.dataGatheringService.gatherSymbols({
dataGatheringItems: [
{
dataSource,
dataSource: activity.SymbolProfile.dataSource,
date: activity.date,
symbol: data.symbol
symbol: activity.SymbolProfile.symbol
}
],
priority: DATA_GATHERING_QUEUE_PRIORITY_HIGH

2
apps/api/src/app/activities/activities.service.ts

@ -183,7 +183,7 @@ export class ActivitiesService {
updateAccountBalance?: boolean;
userId: string;
}
): Promise<Order> {
): Promise<Prisma.OrderGetPayload<{ include: { SymbolProfile: true } }>> {
const tags = data.tags ?? [];
await this.tagService.validateTagIds({

Loading…
Cancel
Save