AuroraMeter.Plan (Aurora Meter v0.1.0)

View Source

A billing plan: an id, a monthly price (minor units / cents), and a map of feature configurations.

Feature configs:

  • {:limit, n, :hard} — hard cap; blocks at n.
  • {:metered, included, unit_price} — allow overage; bill beyond included.
  • {:feature, boolean} — plain feature access (no quota).

Summary

Types

feature_config()

@type feature_config() ::
  {:limit, non_neg_integer(), :hard}
  | {:metered, non_neg_integer(), number()}
  | {:feature, boolean()}

t()

@type t() :: %AuroraMeter.Plan{
  features: %{optional(atom()) => feature_config()},
  id: atom(),
  price: non_neg_integer()
}