AccrueAdmin.Components.AtRiskTable (accrue_admin v1.4.0)

Copy Markdown View Source

Table of subscriptions currently in an active dunning campaign.

Renders below the Recovery 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) | | :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".
  • class (:string) - Defaults to nil.