TieredEntitlements.h header

#include <ew/core/TieredEntitlements.h>

Namespace ew::core

TieredEntitlements class

class ew::core::TieredEntitlements

Entitlements backed by a license tier and a fixed tier->feature-key map (DESIGN.md section 4.19; BUSINESS_DECISIONS.md section 1, which is the single source of truth for what each tier unlocks). Only the networked, cost-to-operate features are gated by a key; everything else — the entire local, single-user application, and bring-your-own AI — is never gated, so it stays available at every tier including LicenseTier::Free. Gating is therefore fail-open: an unknown feature key is always enabled, honouring the Entitlements contract that this seam never blocks a user from their own data. Because the tiers are capability-ordered, a feature gated at Pro is also available to Team/Studio. This is the local, offline half of Phase 24; activating paid billing (which sets the tier from a purchased license) is a separate, service-dependent step.

Members

ew::core::TieredEntitlements::TieredEntitlements(LicenseTier tier)

Builds entitlements for tier. An unlicensed build passes LicenseTier::Free, which unlocks the whole local application and none of the paid networked services.

bool ew::core::TieredEntitlements::isFeatureEnabled(QStringView featureId) const override

True when featureId is available at the configured tier. A key naming a known paid feature is enabled only if the tier meets that feature's minimum; every other key (the local application, BYO-AI, or any unrecognized key) is enabled at every tier.

LicenseTier ew::core::TieredEntitlements::tier() const

The tier these entitlements represent.

static std::optional< LicenseTier > ew::core::TieredEntitlements::minimumTierFor(QStringView featureId)

The minimum tier that unlocks featureId, or std::nullopt when the key is not gated (i.e. it is a free/local feature available to everyone). Exposed for tests and for a settings UI that explains why a paid feature is unavailable.