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.

12 properties
Schema

Properties

PropertyTypeModeDescriptionRequired
tenantTenant
stored

Reference to the Tenant for which this feature is configured

Required
featureFeature
stored

Reference to the Feature being enabled or configured for this tenant

Required
enabledboolean
stored

Whether this feature is currently enabled for the tenant

Example: true

Required
enabledAtdatetime
stored

Date/time when this feature was enabled for the tenant

Example: "2024-01-15T10:30:00Z"

Optional
enabledByUser
stored

Reference to the User who enabled this feature (admin, support, system)

Optional
expiresAtdatetime
stored

Date/time when this feature access expires (null for permanent access)

Example: "2025-01-15T10:30:00Z"

Optional
configurationjson
stored

Feature-specific configuration settings (e.g., API rate limits for api-access, max reports for advanced-reporting)

Example: {"maxReports":100,"exportFormats":["pdf","xlsx","csv"]}

Optional
sourcestring
stored

Source of this feature enablement

Values: subscription-plan, manual-override, trial, promotion

Example: "subscription-plan"

Optional
reasonstring
stored

Reason or notes for enabling this feature

Example: "Included in Enterprise plan subscription"

Optional
isActiveboolean
calculated

Whether this feature is currently active (enabled and not expired and base Feature is active)

Optional
isExpiredboolean
calculated

Whether this feature access has expired

Optional
daysUntilExpirationnumber
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"
}