feat(billing): default the 7-day demo to 3 users
Applying or creating a trial plan sets the owner seat cap to 3, and existing demos without a cap get the same default. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
-- دموی ۷ روزه که هنوز سقف کاربر ندارد، پیشفرض ۳ کاربر میگیرد
|
||||||
|
UPDATE "BillingAccount"
|
||||||
|
SET "maxUsers" = 3
|
||||||
|
WHERE "planCode" = 'trial' AND "maxUsers" IS NULL;
|
||||||
@@ -159,6 +159,7 @@ export class BillingService {
|
|||||||
startsAt: now,
|
startsAt: now,
|
||||||
expiresAt,
|
expiresAt,
|
||||||
maxOrganizations: Math.max(1, opts?.maxOrganizations ?? 1),
|
maxOrganizations: Math.max(1, opts?.maxOrganizations ?? 1),
|
||||||
|
maxUsers: 3,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -301,6 +302,7 @@ export class BillingService {
|
|||||||
expiresAt,
|
expiresAt,
|
||||||
maxOrganizations,
|
maxOrganizations,
|
||||||
expiryNotifiedAt,
|
expiryNotifiedAt,
|
||||||
|
...(planCode === 'trial' ? { maxUsers: 3 } : {}),
|
||||||
...(dto.notes !== undefined ? { notes: dto.notes } : {}),
|
...(dto.notes !== undefined ? { notes: dto.notes } : {}),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -314,6 +316,7 @@ export class BillingService {
|
|||||||
maxOrganizations,
|
maxOrganizations,
|
||||||
notes: dto.notes ?? null,
|
notes: dto.notes ?? null,
|
||||||
expiryNotifiedAt,
|
expiryNotifiedAt,
|
||||||
|
...(planCode === 'trial' ? { maxUsers: 3 } : {}),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (status === 'expired' && !expiryNotifiedAt) {
|
if (status === 'expired' && !expiryNotifiedAt) {
|
||||||
|
|||||||
Reference in New Issue
Block a user