chore: quick access

This commit is contained in:
Matin
2025-02-25 10:38:32 +03:30
parent 37b8e00445
commit 35a61ce90e
9 changed files with 160 additions and 5 deletions
@@ -419,4 +419,19 @@ export class SubscriptionsService {
const growthRate = ((currentYearCount - lastYearCount) / lastYearCount) * 100;
return Math.round(growthRate * 100) / 100;
}
/********************************* */
async activeUserSubscription(userId: string, serviceId: string) {
const activeSubscription = await this.userSubscriptionsRepository.findOne({
where: {
user: { id: userId },
plan: { service: { id: serviceId } },
status: SubscriptionStatus.ACTIVE,
},
relations: ["plan", "plan.service"],
});
console.log(activeSubscription);
return activeSubscription;
}
}