تحلیلگر پرتفوی
تحلیل تخصیص دارایی و ریسک پرتفوی — نیازمند توکن کاربر.
AI insight card for a user-owned portfolio. Replaces the legacy ai-recommendation endpoint.
Canonical contract: USER_PORTFOLIO_FRONTEND_GUIDE.md · portfolios.md
/api/v1/portfolios/{portfolioId}/insights/latestAuth: Required
Response 200: SuccessResponse<PortfolioInsight> — render data.renderedMarkdown (Persian Markdown).
Response 404: No ready insight yet — show empty state + generate CTA.
/api/v1/portfolios/{portfolioId}/insights/refreshAuth: Required
Response 200: SuccessResponse<InsightRefreshResponse> with jobId, portfolioId, status (typically pending).
Response 422: Insights disabled server-side — hide the refresh button.
Suggested UX: call refresh → poll .../insights/latest every 3–5s until a newer version / createdAt, or timeout.
/api/v1/portfolios/{portfolioId}/insightsInsight version history (optional UI).
Deprecated
GET /api/v1/portfolios/{id}/ai-recommendation is not used by the current frontend. Use the insights endpoints above.