Accrue.Billing.UpcomingInvoice (accrue v0.2.0)

Copy Markdown View Source

Non-persistent struct representing a proration preview (BILL-10, D3-19).

Returned from Accrue.Billing.preview_upcoming_invoice/2 and never written to the database — Stripe's upcoming-invoice endpoint is the source of truth, and the result is always a snapshot at fetched_at.

Summary

Types

t()

@type t() :: %Accrue.Billing.UpcomingInvoice{
  amount_due: Accrue.Money.t() | nil,
  currency: atom() | String.t(),
  fetched_at: DateTime.t() | nil,
  lines: [Accrue.Billing.UpcomingInvoice.Line.t()],
  period_end: DateTime.t() | nil,
  period_start: DateTime.t() | nil,
  proration_date: DateTime.t() | nil,
  starting_balance: Accrue.Money.t() | nil,
  subscription_id: String.t() | nil,
  subtotal: Accrue.Money.t() | nil,
  total: Accrue.Money.t() | nil
}