HawkEx.Billing.PlanFeature (hawk_ex v0.1.0)

Copy Markdown View Source

Ecto schema for the value a plan grants for a feature.

PlanFeature is the join table between HawkEx.Billing.Plan and HawkEx.Billing.Feature. The value field is stored as a string so boolean and limit features can share the same table.

Examples:

  • Pro plan, api_calls, "1000".
  • Free plan, api_calls, "100".
  • Pro plan, export_csv, "true".
  • Free plan, export_csv, "false".

The associated feature's feature_type determines how the value is interpreted by HawkEx.Entitlements.

Summary

Functions

Builds a changeset for a plan-feature grant.

Functions

changeset(plan_feature, attrs)

Builds a changeset for a plan-feature grant.

Each feature can be defined only once per plan.