TenantFeature
Junction entity representing the enablement of a specific feature for a tenant workspace, tracking when features were enabled, by whom, with what configuration, and with optional expiration for trial features. This entity enables feature-based access control where tenants can have features enabled beyond their subscription plan (for trials, promotions, or custom agreements) or features disabled despite being in their plan (for gradual rollout or support issues). It supports feature lifecycle management, A/B testing, progressive feature rollout, temporary feature trials, and feature-specific configuration. The entity tracks the complete audit trail of feature enablement including who enabled the feature, when it was enabled, expiration dates for trial features, and custom configuration parameters for each feature. It serves as the foundation for feature gating, entitlement management, and flexible feature access control across multi-tenant SaaS platforms.
Properties
| Property | Type | Mode | Description | Required |
|---|---|---|---|---|
| tenant | Tenant | stored | Reference to the Tenant for which this feature is configured | Required |
| feature | Feature | stored | Reference to the Feature being enabled or configured for this tenant | Required |
| enabled | boolean | stored | Whether this feature is currently enabled for the tenant Example: | Required |
| enabledAt | datetime | stored | Date/time when this feature was enabled for the tenant Example: | Optional |
| enabledBy | User | stored | Reference to the User who enabled this feature (admin, support, system) | Optional |
| expiresAt | datetime | stored | Date/time when this feature access expires (null for permanent access) Example: | Optional |
| configuration | json | stored | Feature-specific configuration settings (e.g., API rate limits for api-access, max reports for advanced-reporting) Example: | Optional |
| source | string | stored | Source of this feature enablement Values: Example: | Optional |
| reason | string | stored | Reason or notes for enabling this feature Example: | Optional |
| isActive | boolean | calculated | Whether this feature is currently active (enabled and not expired and base Feature is active) | Optional |
| isExpired | boolean | calculated | Whether this feature access has expired | Optional |
| daysUntilExpiration | number | calculated | Number of days until this feature expires (null if no expiration) | Optional |
Examples
Example 1
{
"@type": "TenantFeature",
"tenant": {
"@type": "Tenant",
"slug": "acme-corp",
"name": "ACME Corporation"
},
"feature": {
"@type": "Feature",
"key": "advanced-reporting",
"label": "Advanced Reporting"
},
"enabled": true,
"enabledAt": "2024-01-01T00:00:00Z",
"source": "subscription-plan",
"reason": "Included in Enterprise plan"
}Example 2
{
"@type": "TenantFeature",
"tenant": {
"@type": "Tenant",
"slug": "techstart",
"name": "TechStart Inc"
},
"feature": {
"@type": "Feature",
"key": "api-access",
"label": "API Access"
},
"enabled": true,
"enabledAt": "2024-11-20T09:00:00Z",
"enabledBy": {
"@type": "User",
"username": "admin"
},
"expiresAt": "2024-12-20T23:59:59Z",
"source": "trial",
"reason": "30-day trial of API access",
"configuration": {
"maxApiCallsPerDay": 1000,
"rateLimit": "100/hour"
}
}Example 3
{
"@type": "TenantFeature",
"tenant": {
"@type": "Tenant",
"slug": "small-biz",
"name": "Small Business Co"
},
"feature": {
"@type": "Feature",
"key": "white-labeling",
"label": "White Labeling"
},
"enabled": true,
"enabledAt": "2024-06-01T10:00:00Z",
"enabledBy": {
"@type": "User",
"username": "sales.admin"
},
"source": "manual-override",
"reason": "Custom agreement - promotional white-labeling"
}