fix(web): show billing period end date instead of "N/A" on cancel control #318
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-330"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #317 (BUNYIP-330).
The member dashboard cancel-at-period-end button read "Cancel at period end - keep access until N/A", and the "Next Billing" field showed "N/A", whenever
current_period_endhad not yet synced from Stripe (a fresh subscription before thecustomer.subscription.*webhook lands, or any sync gap). The literal "N/A" was anunwrap_or_elsefallback on theNonebranch of the date formatter, so it read like an error instead of an unknown date.This change maps
current_period_endto anOptionrather than collapsingNoneto "N/A", then branches per display site: it renders the formatted date (e.g. "July 14, 2026") when the value is present, and a readable phrase ("the end of your current billing period" on the button, "End of the current billing period" in Next Billing) when it is absent. The three surfaces (Next Billing value, the "Canceled - ends" line, and the cancel button label) are all handled so none can show "N/A".Display-only: no API, model, or migration change.
cargo check,cargo fmt --check, andcargo clippypass onbunyip-web.BUNYIP-330: the member dashboard's cancel-at-period-end button rendered "keep access until N/A", and the "Next Billing" field showed "N/A", whenever current_period_end had not yet synced from Stripe (fresh subscription before the webhook lands, or any sync gap). The literal "N/A" came from an unwrap_or_else fallback on the None branch of the date formatter, so it read like an error rather than an unknown date. Map current_period_end to an Option instead of collapsing None to "N/A", then branch per site: render the formatted date (e.g. "July 14, 2026") when present, and a plain-English phrase ("the end of your current billing period" / "End of the current billing period") when absent. Applied consistently to all three surfaces (Next Billing value, the "Canceled - ends" line, and the cancel button label). Display-only; no API, model, or migration change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGAeN36YQACms3NuYkNR8z