Feature #63
closedFeature #21: Enhance Matching Results and AI Assistant with Company Enrichment and Market Insights
[GetYourJob API] Market-insights proxy route to MatchingAgent
0%
Description
**Surface:** GetYourJob API routes (`GetYourJob/src/app/api/`) + infrastructure adapter (`GetYourJob/src/infrastructure/`).
## Description
Expose the MatchingAgent market-insights aggregates (#2) to the GetYourJob frontend via a Next.js API route, so the Market Insights UI (#5) and the assistant (#6) can consume them without calling MA directly.
- New API route (e.g. `GET/POST /api/market-insights`) that authenticates the session, forwards role/filter params to MatchingAgent (`MATCHING_AGENT_URL`), and returns the aggregate.
- Reuse the existing MatchingAgent adapter pattern (`MatchingAgentAdapter`).
- Cache results (Redis with in-memory fallback) keyed by role/filters to absorb the 100+ batch case.
Depends on #2. Blocks #5 and #6.
## Acceptance criteria
- [ ] `/api/market-insights` returns MatchingAgent aggregates for an authenticated session.
- [ ] Role/filter params are forwarded; unauthenticated requests are rejected.
- [ ] Responses are cached (Redis + in-memory fallback) keyed by role/filters.
- [ ] Adapter/route covered by a test (success + MA-unavailable fallback).
**Estimate:** S