feat(insight-cards): add real-time agent-generated insight cards for … - #606
Merged
Wilfred007 merged 1 commit intoAug 25, 2026
Merged
Conversation
…dashboard Add backend service that aggregates payroll, workforce, liquidity, and schedule data into severity-ranked insight cards. Expose via GET /api/v1/insight-cards with configurable lookback window. Frontend InsightCards component renders cards on the Home page with severity badges, metrics, and deep-link actions. 16 unit tests cover all card generation paths including edge cases and partial failures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…dashboard
Add backend service that aggregates payroll, workforce, liquidity, and schedule data into severity-ranked insight cards. Expose via GET /api/v1/insight-cards with configurable lookback window.
Frontend InsightCards component renders cards on the Home page with severity badges, metrics, and deep-link actions. 16 unit tests cover all card generation paths including edge cases and partial failures.
Closes #1299
Closes #1305
Closes #1296
Closes #1295
Backend (3 new files + 1 modified)
backend/src/schemas/insightCardsSchema.ts— Zod schema definingInsightCard(id, title, body, category, severity, metric, actionRoute) andInsightCardsResponsebackend/src/services/insightCardsService.ts— Core service that runs 4 builders in parallel (payroll, workforce, liquidity, schedule), merges results, and sorts by severity. Each builder is wrapped inPromise.allSettledso partial failures don't break the whole responsebackend/src/routes/insightCardsRoutes.ts—GET /api/v1/insight-cards?windowDays=30with JWT auth + org isolation + EMPLOYER role gatebackend/src/app.ts— Route registeredFrontend (3 new files + 1 modified)
frontend/src/services/insightCardsApi.ts— Typed axios clientfrontend/src/components/InsightCards.tsx— Renders a responsive grid of cards with severity badges, metric callouts, category icons, loading skeletons, and error/retry statesfrontend/src/pages/Home.tsx— InsightCards section inserted between the hero CTA and the static feature cardsTests (16 passing)
backend/src/services/__tests__/insightCardsService.test.ts— Covers all card IDs: payroll disbursed/failure/no-activity, workforce headcount/high-inactive/no-employees, liquidity not-configured/zero-balance/balance, schedule summary/none/upcoming, plus severity ordering, response shape, and partial-failure resilience