This workflow manages the complete SaaS subscription lifecycle from team creation
through active subscription, including trial periods, grace periods, and restricted access.
Overview
Taskr uses a seat-based subscription model with the following key features:- 30-day free trial with full feature access
- 7-day grace period after trial ends (before restrictions)
- Seat-based billing synced with Stripe
- Feature restrictions when billing is not set up
Subscription States
Trial
30-day free trial with full access to all features
Grace Period
7-day window after trial ends to set up billing
Restricted
Read-only access until billing is configured
Active
Paid subscription with full feature access
Workflow Diagram
Status Timeline
Feature Restrictions by Status
Implementation Details
Trial Status Service
The core logic lives intrial-status-service.ts:
Creating a Trial Subscription
When a new team is created, a trial subscription is automatically provisioned:Automated Status Transitions
1
Trial Expires
Cron job detects trials past their
trialEndDate and transitions them to grace_period.2
Grace Period Expires
Teams past their
graceEndDate without billing setup are transitioned to restricted.3
Billing Setup Complete
After successful Stripe Checkout, the subscription becomes
active.Middleware Enforcement
Feature restrictions are enforced via tRPC middleware:Frontend Integration
- Trial Status Hook
- Action Guard
Seat-Based Billing
Taskr uses per-seat billing where the subscription cost scales with team size.Seat Counting
Stripe Synchronization
Adding a Team Member
Adding a Team Member
When a new member is added:
- Member record created in database
- Seat count incremented
- Stripe subscription quantity updated
- Prorated charge applied
Removing a Team Member
Removing a Team Member
When a member is removed:
- Member status set to inactive
- Seat count decremented
- Stripe subscription quantity updated
- Prorated credit applied
Reconciliation Cron
Reconciliation Cron
Daily cron ensures seat counts match between database and Stripe:
Email Notifications
Extending Trials
Sales and support can extend trials for specific teams:Database Schema
API Endpoints
Stripe Webhook Events
Related Documentation
Billing Setup
Configure billing and subscription settings
Team Management
Add and remove team members (affects seat count)