feat(dashboard): Agent/Agency/Both view toggle#104
Conversation
Comprehensive design spec for the consumer-facing OTA covering: - Application architecture (Next.js 15.x on Vercel, existing NestJS API) - AI Concierge with real API tools (Amadeus, Traveltek, Globus) - Advisor micro-sites synced from TravelLeaders Network profiles - Attribution system with 30-day referral cookies and CRM priority chain - Deals system fed by existing VPS scraper via new API endpoint - Search pages for flights, hotels, cars, cruises, tours, all-inclusives - Data model (advisor_profiles, deals, ota_referrals, itinerary_templates additions) - Auth strategy (public endpoints, service-to-service keys, rate limiting) - Cross-cutting concerns (SEO, a11y, mobile, error handling) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Key corrections based on codebase audit: - cruise-repository (already public) replaces FusionAPI for Phase 1 search - Hotels are composite (Google Places + Amadeus + Booking.com), not Amadeus-only - Template publishing uses separate ota_published_trips table with snapshot (itinerary_templates stores JSON blobs, not relational itinerary data) - Flights/hotels need public facade endpoints (existing are JWT-gated) - Airport lookup endpoint needed for flight search UX - tour-repository and Globus live proxy both already public - Updated API endpoints to reflect actual vs new capabilities Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- FusionAPI required for live cruise pricing (not just catalog) - Remove Booking.com from hotel search — Amadeus only - Defer car rentals to Phase 2 (no provider exists) - Update all search, tool, and endpoint references accordingly Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Admins can now switch between Agent view (personal trips only), Agency view (all agency trips), or Both (current behavior). The toggle scopes KPI cards, charts, widgets, and leaderboard visibility. Selection persists to localStorage. Non-admin users always see personal view only. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThe PR introduces a dashboard view filtering feature that allows users to toggle between personal, agency, and all data views. Changes include: localStorage-persisted view state in the UI layer, a new Changes
Sequence DiagramsequenceDiagram
participant User as User (Admin)
participant UI as Dashboard Page
participant LocalStorage as localStorage
participant Hook as useDashboardOverview Hook
participant Controller as API Controller
participant Service as Dashboard Service
participant DB as Database
User->>UI: Toggle view (personal/agency/all)
UI->>UI: Update React state (view)
UI->>LocalStorage: Save "dashboard-view" key
UI->>Hook: Call useDashboardOverview({view})
Hook->>Hook: Build query key with view parameter
Hook->>Controller: GET /dashboard/overview?view=...
Controller->>Service: getOverview(auth, {view, ...})
Service->>Service: Determine needsPersonal & needsAgency<br/>based on view parameter
alt view = 'personal'
Service->>DB: Fetch personal KPIs & widgets
else view = 'agency'
Service->>DB: Fetch agency KPIs & widgets
else view = 'all'
Service->>DB: Fetch both personal & agency data
end
DB-->>Service: Return conditional data
Service-->>Controller: Return filtered dashboard data
Controller-->>Hook: Response with view-specific data
Hook-->>UI: Update query data
UI->>UI: Render KPIs & charts<br/>based on view selection
UI-->>User: Display filtered dashboard
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit