AccrueAdmin.Components.AtRiskTable (accrue_admin v1.5.0)

Copy Markdown View Source

Table of subscriptions currently in an active dunning campaign.

Renders as the Recovery work queue before the supporting funnel on /billing/analytics/recovery.

Per-row map contract

Each map in rows must contain these keys (from Accrue.Analytics.Dunning.at_risk_subscriptions/1):

keytypedisplay
:subscription_idbinary UUIDdrill-down href
:customer_idbinary UUIDunused directly (href uses subscription_id)
:customer_label`String.t()nil`Customer cell text (name or email)
:amount_due_minor`integer()nil`optional amount currently at risk

| :currency | String.t() | atom() | nil | optional currency for amount display | | :days_in_campaign | non_neg_integer() | displayed as "N days" | | :current_step | non_neg_integer() | 0 → "Pending"; N → "Step N" | | :next_step_eta | %DateTime{} | nil | formatted as date-time string; nil → "—" | | :failure_reason | map() | nil | most-recent invoice.payment_failed data; extracts failure_code/failure_message keys; nil or missing invoice → "—" |

Example

<AtRiskTable.at_risk_table rows={@at_risk} base_path={@admin_mount_path} />

Summary

Functions

at_risk_table(assigns)

Attributes

  • rows (:list) (required)
  • base_path (:string) - Defaults to "/billing".
  • owner_scope (:any) - Defaults to nil.
  • class (:string) - Defaults to nil.
  • loading (:boolean) - Defaults to false.
  • error (:any) - Defaults to nil.
  • next_cursor (:string) - Defaults to nil.
  • load_more_href (:string) - Defaults to nil.
  • empty_copy (:map) - Defaults to nil.