AuroraMeter.Schema.PlanVersion (Aurora Meter v1.0.0)

View Source

One snapshot of a plan version's commercial content.

Written only by AuroraMeter.Plans.register!/0, from compiled code, and never updated: a row is immutable once inserted. The table is not a plan catalogue and nothing reads it to decide what a plan is. Code is authoritative (v1-release.md 07.02); the snapshot exists so a subscription or an event that names a version whose block has been deleted from the host's plans module is still interpretable.

fingerprint is the sha256 of the canonical form AuroraMeter.Plans.Snapshot renders a plan's commercial content into, and definition is the same content in a decodable jsonb shape.

Summary

Functions

Builds a changeset for a plan version snapshot.

Types

t()

@type t() :: %AuroraMeter.Schema.PlanVersion{
  __meta__: term(),
  definition: term(),
  effective_at: term(),
  fingerprint: term(),
  first_seen_at: term(),
  id: term(),
  plan_id: term(),
  version: term()
}

Functions

changeset(plan_version, attrs)

@spec changeset(t(), map()) :: Ecto.Changeset.t()

Builds a changeset for a plan version snapshot.