fix : free plan

This commit is contained in:
morteza-mortezai
2025-11-13 11:06:06 +03:30
parent f3ddddc442
commit 783fe1aac1
@@ -230,12 +230,17 @@ export class SubscriptionsService {
if (plan.isFree) {
isFree = true;
const oneMonthAgo = dayjs().subtract(1, "month").toDate();
// const oneMonthAgo = dayjs().subtract(1, "month").toDate();
const existingFreePlanSubscription = await queryRunner.manager.findOne(UserSubscription, {
where: {
user: { id: userId },
plan: { isFree: true },
startDate: MoreThan(oneMonthAgo),
plan: {
isFree: true,
service: {
id: serviceId,
},
},
// startDate: MoreThan(oneMonthAgo),
},
relations: {
plan: true,