whisper-money/resources/js
Víctor Falcón 2bfb569a22
fix(account): block deletion while subscription or trial is active (#531)
## Problem

Self-deleting an account via **Settings → Delete account** only called
`markAsDeleted()`. It never checked or cancelled the Stripe
subscription, so a user could delete their account while still
subscribed and **keep getting billed** afterwards. The `user:delete` CLI
command already cancelled the subscription, but the web path never got
that logic.

## Fix

Block account deletion while the user is **on a trial** or holds a
**valid, uncancelled subscription**, and direct them to cancel via the
billing portal first.

- `User::hasActiveSubscriptionOrTrial()` — true on a trial or a
`valid()` subscription; **grace-period** (already-cancelled)
subscriptions are excluded since they won't re-bill, so deletion is
still allowed.
- `ProfileController::destroy()` — rejects with a `subscription` error
before deleting (server-side guard, also covers non-UI calls).
- Delete-account page now receives `hasActiveSubscriptionOrTrial`; when
set, the UI shows a warning + **Manage billing** link and hides the
delete dialog.
- Spanish translations added for the two new strings.

The `user:delete` CLI is unchanged — it keeps its
auto-cancel-with-confirmation flow for admin use.

## Tests

- Active subscription → deletion blocked
- Trialing subscription → deletion blocked
- Grace-period (cancelled) subscription → deletion allowed
- Delete-account page exposes the flag (true/false)

All passing locally, alongside Pint / Prettier / ESLint.
2026-06-14 20:46:44 +02:00
..
components fix(account): block deletion while subscription or trial is active (#531) 2026-06-14 20:46:44 +02:00
contexts Move transaction filtering from client-side to server-side (#126) 2026-02-16 12:49:04 +01:00
hooks feat(ai): suggest automation rules during onboarding (#523) 2026-06-13 22:51:15 +02:00
layouts feat(ai): suggest automation rules during onboarding (#523) 2026-06-13 22:51:15 +02:00
lib feat(transactions): save and reuse transaction filters (#496) 2026-06-05 18:00:14 +02:00
pages fix(account): block deletion while subscription or trial is active (#531) 2026-06-14 20:46:44 +02:00
providers fix: move community link to user menu (#442) 2026-05-27 17:39:26 +02:00
services feat: optionally update manual account balance on transaction delete (#491) 2026-06-05 11:30:31 +02:00
types feat(transactions): save and reuse transaction filters (#496) 2026-06-05 18:00:14 +02:00
utils feat(currency): add NZD (New Zealand Dollar) (#504) 2026-06-08 09:18:17 +02:00
app.tsx fix(sentry): only report errors in production (#467) 2026-06-01 12:41:31 +02:00
ssr.tsx Remove plaintext-transactions feature flag & E2E references (#116) 2026-02-13 11:10:21 +01:00