fix(web): show billing period end date instead of "N/A" on cancel control #318

Merged
longjacksonle merged 1 commit from fix/BUNYIP-330 into main 2026-07-02 01:16:12 +02:00

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_end had not yet synced from Stripe (a fresh subscription before the customer.subscription.* webhook lands, or any sync gap). The literal "N/A" was an unwrap_or_else fallback on the None branch of the date formatter, so it read like an error instead of an unknown date.

This change maps current_period_end to an Option rather than collapsing None to "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, and cargo clippy pass on bunyip-web.

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_end` had not yet synced from Stripe (a fresh subscription before the `customer.subscription.*` webhook lands, or any sync gap). The literal "N/A" was an `unwrap_or_else` fallback on the `None` branch of the date formatter, so it read like an error instead of an unknown date. This change maps `current_period_end` to an `Option` rather than collapsing `None` to "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`, and `cargo clippy` pass on `bunyip-web`.
fix(web): show billing period end date instead of "N/A" on cancel control
All checks were successful
E2E / Playwright against deployment (pull_request) Successful in 28s
Check / fmt + clippy + build + tests (pull_request) Successful in 9m12s
Create release / Create release from merged PR (pull_request) Has been skipped
4829c24f7a
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
longjacksonle scheduled this pull request to auto merge when all checks succeed 2026-07-02 01:08:00 +02:00
longjacksonle deleted branch fix/BUNYIP-330 2026-07-02 01:16:13 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/bunyip!318
No description provided.