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:
2026-11-02 19:55:51 +03:30
co-authored by Cursor
parent 1b10ee30df
commit fdabdc54a3
2 changed files with 7 additions and 0 deletions
@@ -0,0 +1,4 @@
-- دموی ۷ روزه که هنوز سقف کاربر ندارد، پیش‌فرض ۳ کاربر می‌گیرد
UPDATE "BillingAccount"
SET "maxUsers" = 3
WHERE "planCode" = 'trial' AND "maxUsers" IS NULL;
+3
View File
@@ -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) {