AuroraMeter. Schema. CreditBalance
(Aurora Meter v0.4.0)
View Source
A tenant's prepaid credit balance, one row per tenant, in micro-dollars
(1e-6 USD; see AuroraMeter.Credits.Money).
balance— everything granted minus everything settled, debited or expired; signed, because a settlement may exceed its hold.held— the sum of pending holds;balance - heldis whatAuroraMeter.Credits.available/1returns.promotional— the part ofbalancethat came from promotional grants; consumed before paid credit and the only part that can expire.low_balance_threshold— per-tenant override of:credits_low_balance_threshold.
The row is only ever changed by the AuroraMeter.Credits ledger under a
FOR UPDATE lock, alongside an AuroraMeter.Schema.CreditTransaction.
Summary
Functions
Builds a changeset for a balance row (used for the threshold setter).
Types
Functions
@spec changeset(t(), map()) :: Ecto.Changeset.t()
Builds a changeset for a balance row (used for the threshold setter).