|
@ -645,7 +645,7 @@ export class AdminService { |
|
|
Order: { |
|
|
Order: { |
|
|
where: { |
|
|
where: { |
|
|
User: { |
|
|
User: { |
|
|
Subscription: { |
|
|
subscriptions: { |
|
|
some: { |
|
|
some: { |
|
|
expiresAt: { |
|
|
expiresAt: { |
|
|
gt: new Date() |
|
|
gt: new Date() |
|
@ -806,7 +806,7 @@ export class AdminService { |
|
|
createdAt: true, |
|
|
createdAt: true, |
|
|
id: true, |
|
|
id: true, |
|
|
role: true, |
|
|
role: true, |
|
|
Subscription: { |
|
|
subscriptions: { |
|
|
orderBy: { |
|
|
orderBy: { |
|
|
expiresAt: 'desc' |
|
|
expiresAt: 'desc' |
|
|
}, |
|
|
}, |
|
@ -821,7 +821,7 @@ export class AdminService { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
return usersWithAnalytics.map( |
|
|
return usersWithAnalytics.map( |
|
|
({ _count, Analytics, createdAt, id, role, Subscription }) => { |
|
|
({ _count, Analytics, createdAt, id, role, subscriptions }) => { |
|
|
const daysSinceRegistration = |
|
|
const daysSinceRegistration = |
|
|
differenceInDays(new Date(), createdAt) + 1; |
|
|
differenceInDays(new Date(), createdAt) + 1; |
|
|
const engagement = Analytics |
|
|
const engagement = Analytics |
|
@ -830,8 +830,8 @@ export class AdminService { |
|
|
|
|
|
|
|
|
const subscription = |
|
|
const subscription = |
|
|
this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION') && |
|
|
this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION') && |
|
|
Subscription?.length > 0 |
|
|
subscriptions?.length > 0 |
|
|
? Subscription[0] |
|
|
? subscriptions[0] |
|
|
: undefined; |
|
|
: undefined; |
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|