# Fitur: Notification Highlight — Klik Notifikasi → Tabel Filtered by ID

## Tujuan
Saat user klik notifikasi, mereka dibawa ke halaman tabel yang sesuai (misalnya Transaksi, Kasbon, dll), tapi hanya menampilkan data spesifik dari notifikasi tersebut. User tetap di halaman tabel dan bisa klik "Tampilkan semua" untuk kembali ke semua data.

## File yang Dibaca

### Backend
- `app/Http/Requests/PaginatedRequest.php` — tambah `highlight` ke `validatedWithDefaults()`
- `app/Services/Admin/Master/CategoryService.php` — tambah `$highlight` parameter + `->where('id', $highlight)`
- `app/Services/Admin/Finance/ExpenseService.php` — sama
- `app/Services/Admin/Finance/EmployeeAdvanceService.php` — sama
- `app/Services/Admin/Finance/Payroll/PayrollPeriodService.php` — sama
- `app/Services/Admin/Finance/Cash/CashTransactionService.php` — sama
- `app/Services/Admin/Master/RawMaterial/RawMaterialService.php` — sama
- `app/Services/Admin/Master/Product/ProductService.php` — sama
- `app/Services/Admin/HR/LeaveRequestService.php` — sama
- `app/Services/Admin/Manage/RestockService.php` — sama
- `app/Services/Admin/Manage/PurchaseService.php` — sama
- `app/Services/Admin/Manage/CuttingService.php` — sama
- `app/Services/Admin/Manage/TransactionService.php` — sama
- 13 Controller files — tambah `'highlight' => $request->input('highlight')` ke Inertia::render
- 14 Service files — update notification URL dengan `['highlight' => $entity->id]`

### Frontend
- `resources/js/components/notifications/notification-bell.tsx` — mark as read saat klik
- 13 Index pages — tambah `highlight?: number` prop + info message

## Pola yang Ditemukan

### Backend Flow
1. `PaginatedRequest` validasi `highlight` query parameter
2. `validatedWithDefaults()` return `highlight` ke controller
3. Controller spread ke service: `$this->service->paginated(...$request->validatedWithDefaults())`
4. Service filter: `->when($highlight, fn ($q) => $q->where('id', $highlight))`
5. Controller pass `highlight` ke view: `'highlight' => $request->input('highlight')`

### Frontend Flow
1. Notification URL sudah include `?highlight={id}` (contoh: `/admin/manage/transactions?highlight=123`)
2. Klik notifikasi → `router.visit(notification.url)` + `markAsRead(id)`
3. Halaman index terima `highlight` prop
4. Tampilkan info message: "Menampilkan data dari notifikasi. [Tampilkan semua]"
5. Klik "Tampilkan semua" → navigasi ke index tanpa highlight parameter

### Notification URL Pattern
```php
// Sebelum:
url: route('admin.manage.transactions.index')

// Sesudah:
url: route('admin.manage.transactions.index', ['highlight' => $order->id])
```

## Perubahan yang Dilakukan

### 1. PaginatedRequest (`app/Http/Requests/PaginatedRequest.php`)
- Tambah `'highlight' => $validated['highlight'] ?? null` ke `validatedWithDefaults()`

### 2. Services (14 files)
- Tambah `?int $highlight = null` parameter ke `paginated()` method
- Tambah `->when($highlight, fn ($q) => $q->where('id', $highlight))` di query

### 3. Controllers (13 files)
- Tambah `'highlight' => $request->input('highlight')` ke Inertia::render data

### 4. Notification URLs (48 call sites di 14 service files)
- Update semua `route('...')` menjadi `route('...', ['highlight' => $entity->id])`

### 5. Notification Bell (`notification-bell.tsx`)
- Tambah `markAsRead()` saat klik notifikasi (sebelum navigasi)

### 6. Index Pages (13 files)
- Tambah `highlight?: number` ke Props type
- Tambah `highlight` ke destructured props
- Tambah info message di PageHeader dengan tombol "Tampilkan semua"

## Catatan
- Attendance page menggunakan pattern berbeda (year/month params), jadi "Tampilkan semua" preserve year/month
- Jobs (CheckAttendancePenaltiesJob, SendAttendanceReminderJob) tidak di-update karena tidak ada specific entity ID
- Pre-existing TypeScript errors tidak terkait dengan fitur ini
