========================================
[Sun Feb  8 23:43:11 AEDT 2026] CC VPS triggered by Rivet
========================================

Task:
Fix bug: Dashboard N+1 query in dashboard/page.tsx:60-84. Currently loops through hired matches making ~2 DB calls each. Refactor to use a single .in() query to fetch all data at once. Check how other endpoints use .in() for batch queries.
----------------------------------------

## ✅ Fixed N+1 Query in Dashboard

**Problem:** Lines 60-84 looped through hired matches making ~2 DB calls each (rating check + profile fetch).

**Solution:** Refactored to use batch queries with `.in()`:
- Fetch all ratings in one query with `.in("match_id", matchIds)`
- Fetch all profiles in one parallel query with `.in("id", workerIds)` 
- Use Map/Set for O(1) lookups when building pending ratings list

**Performance:**
- **Before:** ~2N DB calls (2 per hired match)
- **After:** 2 total DB calls (both run in parallel)

Built successfully, app restarted, committed and pushed.

----------------------------------------
[Sun Feb  8 23:44:30 AEDT 2026] Task finished (exit code: 0)
