# System activity notifications

## Client lifecycle recipients

Website client registrations notify:

1. Every administrator whose `is_super_admin` value is `yes`, `1`, or `true`.
2. The referral-code owner, when a referral code was supplied.
3. Only that referral owner's direct parent.

Administrators from unrelated branches are not included.

Client profile updates, status changes, bans, activations, and deletions notify super administrators plus the client's owning administrator hierarchy. Update notifications contain a sanitized field-level difference. Passwords, tokens, API credentials, MT4 credentials, two-factor secrets, and confirmation codes are never copied into notification payloads.

## Module activity

The application listens for Eloquent `created`, `updated`, and `deleted` events across `App\Models`. Purpose-built finance, KYC, contact-message, import, and other high-volume internal records are excluded to prevent duplicates and notification floods.

Legacy administrator routes that mutate data through `DB::table()` are covered by `CaptureAdminMutationActivity`. It sends a fallback notification only when the request succeeded and neither a model event nor a dedicated notification was delivered.

All administrator activity notifications use the existing private channel:

```text
private-App.Models.User.{user_id}
```

Database storage is performed before Pusher broadcasting, so an unavailable Pusher connection does not discard the unread notification.

## Diagnostic

```bash
php artisan notifications:diagnose-activity
php artisan notifications:diagnose-activity --send --user=1
```

The second command creates a real database notification and broadcasts it to the selected administrator.

## Client list filters

The administrator client list supports identity, status, ownership, email confirmation, KYC, 2FA, country, city, language, date ranges, related lead, MT4 account count, account limit, login, group, currency, enabled/read-only status, and successful deposit/withdrawal/credit history filters.
