66 lines
6.2 KiB
Markdown
66 lines
6.2 KiB
Markdown
# Junior Developer — Follow-up Tasks
|
||
|
||
**Date:** 2026-06-01
|
||
**Author:** Review pass cross-referencing `JUNIOR_REPORT.md` against `JUNIOR_ONBOARDING.md`, `SCAFFOLDING_HANDOFF_SENIOR.md`, and the actual repository state.
|
||
|
||
---
|
||
|
||
## ⚠️ Read this first — the reported work is not in the repository
|
||
|
||
`JUNIOR_REPORT.md` describes Tasks 1–9 as complete or partially complete, but **none of the files it claims to have created are present in the repo.** A full sweep of `backend/` and `frontend/` finds only the senior's Session-1 scaffolding (the `VacationDays` backend slice, the `useVacationDays` hook, the `VacationDaysList` reference component, the page stubs, and the shared types). The entity + abstract-repo + SQLite-repo files for `child`, `planned_leave`, and `break_period` exist, but those were built by the **senior** in Session 1 — not the junior's claimed service/model/router/test layers.
|
||
|
||
There is no Git repository in the project folder, so this can't be explained by an unmerged branch. Most likely the work lives in a workspace that was never committed/copied here, or was lost.
|
||
|
||
**Action needed:** please land your actual work in this project folder. Until then, treat every task below as outstanding. A couple of report details suggest the work may need redoing regardless — e.g. the report lists the backend date helper as `backend/app/utils/dates.ts` (a TypeScript extension on a Python file); the backend file must be `app/utils/dates.py`.
|
||
|
||
If I'm wrong and the work exists somewhere, just point me at it and I'll re-verify.
|
||
|
||
---
|
||
|
||
## Backend tasks (all currently missing from the repo)
|
||
|
||
### 1. BreakPeriod tests — `tests/unit/test_break_period_repository.py`
|
||
Not present. The entity, schema, SQLite repo, `services/break_period_service.py`, and `routers/break_periods.py` all exist, so this is pure test-writing. Follow `tests/unit/test_vacation_days_repository.py` and use the `seeded_ids` fixture in `tests/conftest.py` so the workspace/personal_data FK constraints pass. Note the sharp edge: `BreakPeriodUpdate` currently has all-required fields, so every update test must supply the full body (see `SENIOR_FOLLOWUP.md` — this may change to Optional).
|
||
|
||
### 2. Child CRUD + settings endpoints
|
||
Missing: `models/child.py`, `services/child_service.py`, and the routes. (`entities/child.py`, `repositories/child_repository.py`, `repositories_impl/sqlite/child_repository.py` already exist.) Copy the `VacationDays` slice. Wire `PUT /api/settings/child/{child_id}` and `POST /api/children` per `ARCHITECTURE.md §5`, including `preschool_start_date` with validation `preschool_start_date > birth_date`. Add the routes to `routers/settings.py` (which today only exposes tips + break-period routes).
|
||
|
||
### 3. PlannedLeaveDay CRUD + PlanningService
|
||
Missing: `models/planned_leave.py`, `services/planning_service.py`, `routers/planned_days.py`. (Entity + repos exist.) `add_planned_day` must validate against the day budget and dubbeldagar rules — inject `AnalyticsService.validate_dubbeldagar` (already implemented) rather than re-implementing it. See `ARCHITECTURE.md §4.3` and `§5`. This depends on Child (Task 2) existing.
|
||
|
||
### 4. PersonalData (parent-profile) settings endpoint
|
||
Missing: `PUT /api/settings/parent/{personal_data_uuid}` to update `salary_type` and `employment_status`. A thin service method over `PersonalDataRepository.update` plus the route in `routers/settings.py`. Note: workspace-level `planning_goal` is already updatable via `PUT /api/workspaces/{id}` (senior-built), so that part of the original "Task 3" is done — only the per-parent endpoint is outstanding.
|
||
|
||
### 5. Date helpers — `app/utils/dates.py` (Python, not `.ts`)
|
||
Missing. Pure functions with thorough unit tests: `add_months(date, n)`, `age_in_months(birth_date, on)`, `fourth_birthday(birth_date)`, plus the leap-year / month-end edge cases. The planning + calendar features depend on these, so correctness matters.
|
||
|
||
### 6. Swedish public-holiday helper — `app/utils/holidays.py`
|
||
Missing. Given a year, return the röda dagar (use the `holidays` library, Sweden locale; cache per year). Unit-test known dates. Needed by the calendar UI and the "wrap red days with vacation" tip. (`holidays` is already a dependency.)
|
||
|
||
---
|
||
|
||
## Frontend tasks (all currently missing from the repo)
|
||
|
||
The only frontend code present is the senior's reference set: `hooks/useVacationDays.ts`, `components/vacation-days/VacationDaysList.tsx` (+ test), the contexts, the typed API client, the shared `types/`, and the page stubs.
|
||
|
||
### 7. Presentational components — `components/`
|
||
Missing entirely. Build, each as `.tsx` + `.css` + `.test.tsx`, props-only, no business logic: `LoadingSpinner`, `Header`, `Footer`, `Layout`, `CalendarDay`, `CalendarEvent`, `OverviewMetrics`, `DaysBreakdown`, `ProgressChart`, `TipCard`, and the settings inputs (`VacationDaysInput`, `ChildBirthdayInput`, `ParentProfileInput`, `PlanningGoalSelector`, `BreakPeriodsInput`). Mirror `VacationDaysList.test.tsx` for the render tests.
|
||
|
||
### 8. Frontend utils — `src/utils/dates.ts` and `src/utils/formatting.ts`
|
||
Missing. Date formatting/calculation helpers and number/day/sv-SE formatting, each **with Vitest tests** (the report explicitly noted tests were not written — they are required by the Definition of Done).
|
||
|
||
### 9. Data hooks — `src/hooks/`
|
||
Missing: `useBreakPeriods.ts`, `usePlannedDays.ts`, `useParentalLeave.ts`, `useAnalytics.ts`, `useOptimizationTips.ts`, each with a matching `*.test.tsx`. Follow the `useVacationDays.ts` shape: `{ data, isLoading, error, ... actions, refresh }`.
|
||
|
||
---
|
||
|
||
## Definition of done (unchanged from onboarding)
|
||
|
||
Fully typed (no unexplained `any`, type hints on all Python); tests added with **≥90% coverage** on new code (happy path **and** error cases); `ruff check` / ESLint clean; errors raised as `DomainError` subclasses; Swedish rule numbers come from `config.py::LeaveRules`, never hard-coded; small focused PRs. The CI gate (`--cov-fail-under=90`) currently fails because most of the app is stubbed — see `SENIOR_FOLLOWUP.md`; your tests are part of closing that gap.
|
||
|
||
---
|
||
|
||
## Out of scope (still senior-owned)
|
||
|
||
The FK scraper / BankID flow, auth & security internals, the days-left-at-age-4 calculation, the tips-engine *rule logic* (you may build the `TipCard` presentational component), and DB migrations / connection pooling. See `SENIOR_FOLLOWUP.md`.
|