Feature #11617
closedSupport #11764: E-commerce pending tasks for nov 15 release
Feature #11610: Free Trial Integration in Company on boarding
Task 5: Operational Access & Read-Only / Grace Enforcement
Description
Purpose: Protect the business from unpaid operations while maintaining customer trust and avoiding data hostage disputes.
Detailed Explanation:
Active Trial Permissions: While a tenant is in an active trial, all core operational features (cashier checkout, product creation, inventory management) function normally within their designated trial quotas.
Post-Trial Failed Conversion (Read-Only Mode): If a trial expires and the card payment is declined, the application must immediately switch into Read-Only mode during the 7-day grace period. In this mode, store staff cannot process new sales, create inventory, or send SMS/emails, but the account owner can log in, view historical records, export data reports, and access the billing screen to update their payment method.
Full Suspension After Grace Expiration: If the 7-day grace period elapses without a successful payment, all tenant workspace requests are locked with a suspension screen requiring payment to reactivate.
Subtasks
Related issues
Updated by Divya Inapakurthi 11 days ago
- Target version set to sprint (10/12/2026 - 10/31/2026)
Updated by Divya Inapakurthi 2 days ago
Work Completed for Task 5: Operational Access & Read-Only / Grace Enforcement¶
- Backend Read-Only Grace Middleware Enforcement (`nursery.token.js`, `tenantPermissions.js`):
- Implemented access control guardrails for tenants whose trial or payment has lapsed (`past_due` / `isReadOnlyGrace: true`).
- Allowed unhindered `GET` requests so tenants can view historical transactions, reports, inventory records, and settings.
- Intercepted and blocked mutating requests (`POST`, `PUT`, `DELETE`, `PATCH`) with a `403 Forbidden` response explaining the 7-day grace period with direct CTA to update payment details.
- Dunning & Automated Expiration Lifecycle (`tenantBilling.service.js`, `tenantDunningCron.js`):
- Integrated automated 7-day grace calculation (`graceEndsAt = now + gracePeriodDays`) upon trial completion or failed renewal.
- Automated tenant status transition from `grace` / `past_due` to `suspended` when `graceEndsAt` has elapsed without payment resolution.
- Tenant Notification & Lifecycle Mailers (`subscriptionBillingMailer.js`):
- Implemented automated emails (`sendTrialConversionFailedEmail`, `sendSubscriptionStatusAlertEmail`) notifying company owners of the active 7-day grace period, read-only operational scope, and grace expiration date with direct Stripe portal links.
- Frontend UI & Banner Experience (`PlanExpiryBanner.tsx`):
- Added dedicated styling and messaging for `"⚠️ Read-Only Grace Period"`.
- Displayed remaining grace days and an `"Update Payment Method"` action button linking directly to the billing portal.
Updated by Divya Inapakurthi 2 days ago
- Status changed from New to Closed
- % Done changed from 0 to 100