Insights — Code Map
API
apps/api/src/insights/insights.module.tsapps/api/src/insights/insights.controller.ts— singleGET /organizations/:orgId/insightsendpoint.apps/api/src/insights/insights.service.ts—getOrgInsights(orgId, { role })orchestrator,evalCancellationRequests,evalOutstandingDebt,evalAtRiskBilling,evalTasksOverdue.apps/api/src/insights/insights.service.driver.ts— test driver.apps/api/src/insights/insights.service.unit.spec.ts— rule unit tests.apps/api/src/insights/insights.controller.unit.spec.ts— controller-level tests (auth, shape).
Agent surface
apps/api/src/ai/agent/tools/leaves/analytics.tools.ts—org_insightsaction delegates toInsightsService.getOrgInsights.
Web
apps/web/src/components/overview/v2/action-center.tsx— renders the feed on the dashboard overview. The frontend reads the i18n dictionary byid. (The olderinsights-widget.tsxcard grid was deleted on 2026-08-22 with the legacy overview.)
i18n
apps/web/src/i18n/{en,he,ru}.jsonunderinsight.<id>.{title,description}.
Schema
libs/db/src/lib/schema/payments.ts—subscriptions,cancellation_requests,payment_transactions.libs/db/src/lib/schema/memberships.ts—memberships.libs/db/src/lib/schema/tasks.ts—tasks.libs/db/src/lib/schema/users.ts—users(read for the at-risk sample).