HawkEx.Billing.Feature (hawk_ex v0.1.0)

Copy Markdown View Source

Ecto schema for a feature that can be granted by a plan.

Features are defined once and reused across plans. Each feature has a stable key, such as "export_csv" or "api_calls", and a type:

  • "boolean" - the plan grants or denies a capability with "true" or "false".
  • "limit" - the plan grants a numeric limit or "unlimited".

The value granted by each plan is stored in HawkEx.Billing.PlanFeature.

Summary

Functions

Builds a changeset for creating or updating a feature definition.

Functions

changeset(feature, attrs)

Builds a changeset for creating or updating a feature definition.

Feature keys are application-facing identifiers and must contain only lowercase letters, numbers, and underscores.