fix(web): cancel-at-period-end button shows 'keep access until N/A' instead of the real end date (BUNYIP-330) #317
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/bunyip#317
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Summary
On the member dashboard, the "Cancel Membership" control expands to a "Cancel at period end - keep access until N/A" button. When Stripe's current period end is not known, the label renders the literal string "N/A" instead of a real date, so the member cannot tell how long they keep access after cancelling. The same "N/A" fallback also appears in the "Next Billing" field of the membership card. We want the end date shown specifically, and a clearer fallback when it is genuinely unavailable.
Where
bunyip-web/src/handlers/dashboard.rs(member membership panel):m.current_period_end.as_deref().map(fmt_date_iso).unwrap_or_else(|| "N/A".into()), then renders"Canceled - ends " (end)when cancelling, else(end)."Cancel at period end - keep access until " (end), reusing the sameunwrap_or_else(|| "N/A")fallback.Root cause
current_period_endisOption<DateTime<Utc>>on the domain model (crates/bunyip-domain/src/models/membership.rs:14) andOption<String>on the web API type (bunyip-web/src/api/types.rs:129). It is populated only from the Stripe subscription sync (crates/bunyip-domain/src/services/stripe.rs:686, driven by webhooks). When that value isNone, the Maud template substitutes the literal"N/A".current_period_endisNonewhenever:customer.subscription.created/updatedwebhook has not landed yet.So the "N/A" is the None-branch of the formatter, not a formatting bug in
fmt_date_iso(which correctly renders%B %-d, %Y, e.g. "July 14, 2026", when a value is present).Desired behavior / acceptance criteria
current_period_endis present, the cancel-at-period-end button reads "Cancel at period end - keep access until <Month D, YYYY>" (it already formats correctly; verify it renders once a value exists).current_period_endis absent, replace the bare "N/A" with a clear phrase that does not imply an error, e.g. "keep access until the end of your current billing period" for the cancel button, and a comparable non-"N/A" fallback for the "Next Billing" field.Notes
Display-only,
bunyip-webtemplating change. No migration, no API change. Relates to the BUNYIP-291 cancel-control work that introduced this combined cancel UI.