- Create src/lib/redis.ts (singleton client) and src/lib/cache.ts
(cachedQuery with graceful degradation on Redis failure)
- Wrap all 12 API routes and 7 RSC pages with cachedQuery (TTLs:
120s-900s by data type — dashboard 3min, inventory/orders/shipments
5min, BOL/order-ack/traveler 10min, ship-to 15min, avail-coils 2min)
- Fix redundant connection pools in dashboard.ts and shipments.ts
(were creating their own sql.connect instead of using shared pool)
- Add pool tuning to epicor.ts (max:15, min:2, 60s idle, 30s acquire)
- Parallelize session checks (getQuestSession + getActiveCompany +
isSubUser) with Promise.all across all inventory and orders pages
- Add loading.tsx skeletons for dashboard, inventory detail, orders,
and shipments pages for instant shell rendering via Next.js streaming
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
C-005: Order Acknowledgement Detail + PDF
- Order detail page with full line items, releases, addresses, paint codes
- PDF export via Puppeteer matching legacy format
- Clickable order # links and PDF icons in orders table
C-007: BOL Detail + PDF
- BOL detail page with ship-from/to, line items, weights
- PDF export matching legacy BOL format
- PDF icon column in shipments table
C-008: Coil Activity - Usage Report
- Date range picker (max 31 days, default last 10 days)
- Reusable UI: Popover, Calendar (react-day-picker v9), DateRangePicker
- SQL from legacy portal_CoilActivityUsage.sql with OnHandQty dedup
- 11-column sortable table with search and CSV export
C-009: Coil Activity - Receipts Report
- VGL customer exception (special SQL vs portal view)
- 10-column sortable table with search and CSV export
- Shared date range picker component
Also: dashboard API route, shipments API route, HDC→HDM mapping,
Puppeteer PDF infrastructure, improved error handling.
Progress: 9/16 Phase 2 tasks complete.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>