- Add 8 missing API client functions (getBreakPeriods, createBreakPeriod, deleteBreakPeriod, getTips, getParentalLeave, getPlannedDays, createPlannedDay, deletePlannedDay) - Fix useAnalytics to accept optional childId parameter - Fix ApiError strict optional properties handling - Export HeaderProps from Header component - Update hook tests to use correct data structures and optional parameters npx tsc --noEmit now passes with zero errors. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
4.6 KiB
Junior Developer — Follow-up Tasks (Round 2)
Date: 2026-06-01
Baseline: JUNIOR_REPORT_2.md, verified against the committed code.
Great progress — all the files you reported this round are in the repo, and you were upfront about the two open gaps. The backend tips engine now reads the real planning_goal and BreakPeriodUpdate has a documented contract (both done by the senior), so nothing below is blocked.
The one thing to be aware of: the frontend does not currently compile. Running npx tsc --noEmit fails with many errors, so the frontend CI job is red and the app can't build. Your hook tests pass only because they mock API functions that don't actually exist yet — so the green tests were misleading. Fixing the build is therefore the first priority.
1. Make the frontend compile again (do this first)
Run cd frontend && npx tsc --noEmit and drive it to zero errors. There are three distinct causes:
a. Missing API client functions — src/services/api.ts
The hooks import * as api and call functions that aren't exported. Add these, following the existing getWorkspaceOverview / saveManualFetch pattern already in the file:
getBreakPeriods(workspaceId)createBreakPeriod(workspaceId, payload)deleteBreakPeriod(id)getPlannedDays(workspaceId, childId?)createPlannedDay(workspaceId, childId, payload)deletePlannedDay(id)getParentalLeave(workspaceId)← this one was reported as already existing; it is not in the filegetTips(workspaceId)← also reported as existing; it is not in the file
Match the backend routes the senior/you built (/api/planned-days, /api/break-periods via settings, /api/tips/{workspace_id}, the fetch endpoints). Use the request/response types from types/api.ts.
b. Layout.tsx — HeaderProps not exported
Layout.tsx imports HeaderProps from ./Header, but Header.tsx declares it locally without exporting. Export the type from Header.tsx (or define the props inline in Layout).
c. useAnalytics.ts argument mismatch + unused vars
useAnalytics.ts calls getWorkspaceOverview with one argument but it expects two — align the call with the function signature. Also clear the TS6133 "declared but never read" errors in the hook test files (unused result bindings, etc.).
Done when: npx tsc --noEmit is clean, npm run lint is clean, and npm test passes for real (not just against mocks of missing functions).
2. Build the remaining presentational components
7 of ~14 are still missing. Build each as .tsx + .css + .test.tsx, props-only, no business logic, following your existing Header / Footer / ChildBirthdayInput:
CalendarDay— single day cell (date, events, clickable)CalendarEvent— event badge in a day (leave type + colour)DaysBreakdown— breakdown of days by typeProgressChart— visual progress toward the age-4 deadlineTipCard— single tip (icon, title, body, dismiss)VacationDaysInput— number inputParentProfileInput— selects forsalary_type,employment_statusPlanningGoalSelector— selector for workspaceplanning_goalBreakPeriodsInput— add/edit break periods
Also finish the incomplete Layout.test.tsx.
3. Wire the page stubs into a working app
pages/{Dashboard,Calendar,Tips,Settings}.tsx are still empty stubs — nothing currently assembles the hooks and components into real screens. Wire them up using the contexts (AuthContext, WorkspaceContext), your data hooks, and the components above:
- Dashboard —
useAnalytics+OverviewMetrics+DaysBreakdown+ProgressChart - Calendar —
usePlannedDays+CalendarDay/CalendarEvent - Tips —
useOptimizationTips+TipCard - Settings — the input components + the child/parent/workspace settings endpoints
Keep these presentational where you can; the screens just fetch via hooks and render. If a screen needs real cross-cutting logic, flag it rather than inventing it.
Definition of done (unchanged)
Fully typed (no unexplained any); tests with ≥90% coverage on new code, happy path and error cases; tsc + ESLint clean; small focused commits. Because the build was red, please make "tsc --noEmit clean" an explicit part of your own check before reporting done this time.
Out of scope (senior is handling it)
The tips-engine rule logic in services/tips_service.py (the 9 stubbed SGI / red-day / dubbeldagar rules) — you build the TipCard UI and the useOptimizationTips hook, but not the rule bodies. See SENIOR_FOLLOWUP_2.md.