## What The `encryption:delete-accounts` and `encryption:notify-removal` commands target users who still hold legacy client-side encrypted data. They should **never** warn or delete an account that is still being billed. ## Changes - Add `excludeBilledUsers()` to the shared `FindsUsersWithLegacyEncryption` trait. It drops any user where `hasActiveSubscriptionOrTrial()` is true — a valid subscription outside its grace period, or an active generic trial. This reuses the existing domain method (whose docblock already states such users must cancel before deletion) instead of reimplementing Cashier's subscription-status logic in SQL. - Both commands apply the filter right after fetching their candidates. - Eager-load `subscriptions` in the base query to avoid an N+1 when the filter runs. ## Tests - `it never deletes a subscribed user` (delete command) - `it never warns a subscribed user` (notify command) Both new tests plus the existing suite pass (8/8). Pint clean. |
||
|---|---|---|
| .. | ||
| .pest | ||
| Browser | ||
| Feature | ||
| Fixtures | ||
| Performance | ||
| Support | ||
| Unit | ||
| Pest.php | ||
| TestCase.php | ||
| bootstrap.php | ||