Deprixa Plus — SaaS Billing Module · 8.2 Subscription Lifecycle
State Machine
Subscriptions move through the following states:
| From | To | Trigger |
|---|---|---|
| trial | active | First payment received |
| active | active | Successful renewal |
| active | grace_period | Failed renewal / insufficient wallet balance |
| grace_period | active | Payment received / wallet recharged |
| grace_period | read_only | Grace period expires |
| read_only | active | Payment + reactivation |
| any | suspended | Admin manual action |
| any | cancelled | User or admin cancellation |
What Each Status Means
| Status | User Experience |
|---|---|
| trial / active / grace_period | Full access to all features. Grace period shows a warning banner on POST requests reminding the user to recharge. |
| read_only | Can view everything but cannot create, edit, or delete. All POST / PUT / PATCH requests are blocked. |
| suspended | All features disabled. User is redirected to the billing page. |
| cancelled | No access. User must resubscribe to regain entry. |
Auto-Renewal
The saas:check-subscriptions artisan command runs daily at 01:00. It checks every active subscription approaching expiry, attempts wallet debit, and transitions state accordingly.
Pre-Expiry Warnings
Notification emails are sent at 7 days, 3 days, and 1 day before the subscription expires, giving the organization time to recharge their wallet.
SCREENSHOT — Subscription detail page showing status badge and renewal date