|
@ -1,6 +1,5 @@ |
|
|
import { SubscriptionService } from '@ghostfolio/api/app/subscription/subscription.service'; |
|
|
import { SubscriptionService } from '@ghostfolio/api/app/subscription/subscription.service'; |
|
|
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service'; |
|
|
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service'; |
|
|
import { DataGatheringService } from '@ghostfolio/api/services/data-gathering.service'; |
|
|
|
|
|
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service'; |
|
|
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service'; |
|
|
import { MarketDataService } from '@ghostfolio/api/services/market-data.service'; |
|
|
import { MarketDataService } from '@ghostfolio/api/services/market-data.service'; |
|
|
import { PrismaService } from '@ghostfolio/api/services/prisma.service'; |
|
|
import { PrismaService } from '@ghostfolio/api/services/prisma.service'; |
|
@ -24,7 +23,6 @@ export class AdminService { |
|
|
|
|
|
|
|
|
public constructor( |
|
|
public constructor( |
|
|
private readonly configurationService: ConfigurationService, |
|
|
private readonly configurationService: ConfigurationService, |
|
|
private readonly dataGatheringService: DataGatheringService, |
|
|
|
|
|
private readonly exchangeRateDataService: ExchangeRateDataService, |
|
|
private readonly exchangeRateDataService: ExchangeRateDataService, |
|
|
private readonly marketDataService: MarketDataService, |
|
|
private readonly marketDataService: MarketDataService, |
|
|
private readonly prismaService: PrismaService, |
|
|
private readonly prismaService: PrismaService, |
|
@ -174,7 +172,6 @@ export class AdminService { |
|
|
_count: { |
|
|
_count: { |
|
|
select: { Account: true, Order: true } |
|
|
select: { Account: true, Order: true } |
|
|
}, |
|
|
}, |
|
|
alias: true, |
|
|
|
|
|
Analytics: { |
|
|
Analytics: { |
|
|
select: { |
|
|
select: { |
|
|
activityCount: true, |
|
|
activityCount: true, |
|
@ -194,7 +191,7 @@ export class AdminService { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
return usersWithAnalytics.map( |
|
|
return usersWithAnalytics.map( |
|
|
({ _count, alias, Analytics, createdAt, id, Subscription }) => { |
|
|
({ _count, Analytics, createdAt, id, Subscription }) => { |
|
|
const daysSinceRegistration = |
|
|
const daysSinceRegistration = |
|
|
differenceInDays(new Date(), createdAt) + 1; |
|
|
differenceInDays(new Date(), createdAt) + 1; |
|
|
const engagement = Analytics.activityCount / daysSinceRegistration; |
|
|
const engagement = Analytics.activityCount / daysSinceRegistration; |
|
@ -206,7 +203,6 @@ export class AdminService { |
|
|
: undefined; |
|
|
: undefined; |
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
alias, |
|
|
|
|
|
createdAt, |
|
|
createdAt, |
|
|
engagement, |
|
|
engagement, |
|
|
id, |
|
|
id, |
|
|