A customer's access to a MishkaPay.Feature right now, given by a product they bought, read
with MishkaPay.list_entitlements/4. A guarded_struct the provider fills in.
:provider,:id: the provider's id of the entitlement.:feature_id: the feature it gives.:lookup_key: the feature's lookup key, which the host checks access by.
The provider keeps the list current as subscriptions start and end, and sends a webhook when it
changes (entitlements.active_entitlement_summary.updated at Stripe).
Summary
Functions
A sample %MishkaPay.Feature.Entitlement{} populated from defaults + type-based fallbacks.
Types
@type t() :: %MishkaPay.Feature.Entitlement{ feature_id: String.t() | nil, id: String.t() | nil, lookup_key: String.t() | nil, provider: String.t() | nil }
The struct that builder/1 returns.
| Field | Type | Required | Default | Description | Derives |
|---|---|---|---|---|---|
:provider | String.t() | nil | no | validate(string) | ||
:id | String.t() | nil | no | validate(string) | ||
:feature_id | String.t() | nil | no | validate(string) | ||
:lookup_key | String.t() | nil | no | validate(string) |