Context
PR #655 added a curated plan catalog where org admins link real consultant plans to their org via the existing `organizationProfileId` FK on all 4 plan tables. The org dashboard Plans page shows the curated list and supports browse + add.
This issue covers the learner-facing side: when an org learner browses the public explore page, plans in their org's catalog should show a "Recommended by [OrgName]" badge.
Implementation
Data flow
- The explore page needs to know which org(s) the current user belongs to (from `session.user.organizationMemberships`)
- For each plan card rendered, check if `plan.organizationProfileId` matches any of the user's org profile IDs
- If yes, render a badge: "Recommended by [OrgName]"
Files to modify
- `app/explore/experts/components/ConsultantCard.tsx` — add badge on subscription plan cards
- `app/explore/programs/components/ProgramCard.tsx` — add badge on webinar/class cards
- `lib/data/explore-experts.ts` — include `organizationProfileId` in the plan select
- `app/api/user/consultants/route.ts` — include org profile relation in plan response
- `app/api/plans/classes/route.ts` + `app/api/plans/webinars/route.ts` — include org profile in response
Badge design
- Style: `bg-emerald-50 text-emerald-700 border-emerald-200` (subtle, non-intrusive)
- Icon: Building2 (from lucide-react)
- Text: "Recommended by [OrgName]"
- Position: Below the price or above the CTA button
Scope considerations
- This requires threading session/org context through server components (explore page is partially server-rendered)
- May need a client-side wrapper that reads `useSession()` and passes org IDs down
- OR: pass org profile IDs as a query param to the API and let it annotate matching plans
References
Context
PR #655 added a curated plan catalog where org admins link real consultant plans to their org via the existing `organizationProfileId` FK on all 4 plan tables. The org dashboard Plans page shows the curated list and supports browse + add.
This issue covers the learner-facing side: when an org learner browses the public explore page, plans in their org's catalog should show a "Recommended by [OrgName]" badge.
Implementation
Data flow
Files to modify
Badge design
Scope considerations
References