Appearance
Usage & Limits
Subscription plans enforce quotas on users, branches, messaging, analyzer connectivity, and other resources. Monitor consumption on Admin → Subscription (/admin/subscription) and avoid surprise lockouts.
Permission: subscription.view
Quota model
mermaid
flowchart TB
PLAN[Plan definition] --> Q[Quotas]
Q --> U[Usage counters]
U --> UI[Subscription dashboard]
U --> ENF[Enforcement middleware]
ENF --> ALLOW[Allow]
ENF --> DENY[403 / upgrade CTA]Plans are defined in Platform Packages. Each tenant's active subscription inherits plan limits.
Common limit categories
| Category | Example limit | Over-limit behavior |
|---|---|---|
| Users | 5 seats | Block new user creation |
| Collection centers | 2 branches | Block new center |
| SMS / month | 1,000 messages | Block send or overage charge |
| Analyzer devices | 3 devices | Block new device registration |
| Invoices / month | Plan-specific | Soft warning or hard cap |
| Storage / backups | Retention days | Older backups non-restorable |
Exact limits vary by deployment — always read the live subscription page.
Subscription dashboard
The admin subscription screen shows:
| Widget | Purpose |
|---|---|
| Current plan | Name, renewal date |
| Usage meters | Progress bars per quota |
| Feature flags | Analyzer, reference lab, etc. |
| Upgrade CTA | Link to /billing/plans |
Refresh after bulk onboarding to verify headroom.
Proactive monitoring
Review usage at 80% threshold — adding five receptionists during flu season can exhaust user seats overnight.
Feature flags
IPlanFeatureService gates premium capabilities:
| Feature | Check |
|---|---|
| Analyzer integration | HasAnalyzerIntegrationAsync |
| Reference lab module | Plan-specific |
| Advanced reports | Analytics tier |
| Custom domain | Marketing tier |
Denied features return HTTP 403 with upgrade messaging.
Enforcement points
| Operation | Enforced at |
|---|---|
| Create user | Admin user API |
| Send SMS | Messaging service |
| Analyzer ingest | AnalyzerApiKeyMiddleware |
| Register device | Analyzers controller |
| Backup retention | Backup manifest builder |
Trial limits
Trials typically mirror a mid-tier plan with time box:
| Aspect | Trial |
|---|---|
| Duration | e.g., 14 days from registration |
| Features | Near-full for evaluation |
| End behavior | Read-only until subscribe |
Trial end is evaluated in TenantLockMiddleware — no manual cron required.
Upgrading for headroom
mermaid
flowchart LR
A[Limit warning] --> B[Review /billing/plans]
B --> C[Checkout higher tier]
C --> D[Immediate quota increase]Downgrade the opposite — ensure current usage fits new caps before period end.
Usage vs patient volume
Patient invoice volume is not the same as SaaS subscription usage unless your plan explicitly caps monthly invoices. Distinguish:
| Metric | Billing context |
|---|---|
| SaaS quotas | EaseLab platform |
| Patient revenue | Lab business |
API visibility
Tenant info endpoint exposes lock and payment status:
isLocked/isReadonlypaymentStatustrialEndsAtlockReason
Frontend hooks (useReadonlyMode) consume these fields.
Best practices
| Practice | Benefit |
|---|---|
| Annual capacity planning | Right-size plan |
| Deactivate unused users | Free seats |
| Archive old SMS campaigns | Cleaner logs |
| Monitor analyzer device count | Prevent failed go-live |
Hard blocks
Some limits deny API mutations silently in UI with toast errors — check browser network tab for quota error codes.