Single getList pulls every quote this rep created in the last 62 days, then buckets client-side into the 6 day/week/month windows plus the 8-week trend. Also fans out the 4 remaining queries (outstandingQuotes, outstandingOrderItems probe, monthRevenue, the consolidated quotes fetch) in parallel via Promise.all. Query count: 18 → 5. Page load bounded by the slowest query instead of the sum. The widest quote window is "last month" (~62 days), so that single bound covers every other day/week/month window for bucketing. Cap at 2000 rows to defend against runaway responses for very active reps. |
||
|---|---|---|
| .. | ||
| app | ||
| components | ||
| lib | ||
| styles | ||
| middleware.ts | ||
| test-setup.ts | ||