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,
|
||||
expiresAt,
|
||||
maxOrganizations: Math.max(1, opts?.maxOrganizations ?? 1),
|
||||
maxUsers: 3,
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -301,6 +302,7 @@ export class BillingService {
|
||||
expiresAt,
|
||||
maxOrganizations,
|
||||
expiryNotifiedAt,
|
||||
...(planCode === 'trial' ? { maxUsers: 3 } : {}),
|
||||
...(dto.notes !== undefined ? { notes: dto.notes } : {}),
|
||||
},
|
||||
})
|
||||
@@ -314,6 +316,7 @@ export class BillingService {
|
||||
maxOrganizations,
|
||||
notes: dto.notes ?? null,
|
||||
expiryNotifiedAt,
|
||||
...(planCode === 'trial' ? { maxUsers: 3 } : {}),
|
||||
},
|
||||
});
|
||||
if (status === 'expired' && !expiryNotifiedAt) {
|
||||
|
||||
Reference in New Issue
Block a user