Commit graph

121 commits

Author SHA1 Message Date
efeb619b06 feat: persist Wochenübersicht exports, DAK-Mitarbeiter access + ICD upload
- Wochenübersicht exports now persisted in DB (WeeklyReport) + disk
- POST /reports/wochenuebersicht/generate replaces GET (admin-only)
- POST /reports/wochenuebersicht/upload-icd for ICD upload (all roles)
- GET /reports/list supports report_type_prefix filter
- WochenuebersichtPage: report table + ICD drag-drop upload for all roles
- Route + sidebar open to all authenticated users
- ReportsPage filters out wochenuebersicht report types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 13:51:14 +00:00
6f6a721973 feat: add Wochenübersicht export + ICD import auto-detect
- New Excel export service for weekly DAK summary sheets (c2s / c2s_g_s variants)
- New API endpoint GET /reports/wochenuebersicht (admin-only)
- ICD import auto-detects format (coding template vs. Wochenübersicht KVNR-based)
- New admin frontend page with download form
- Route + sidebar navigation entry

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 13:28:17 +00:00
48939f01dd feat: add Onko-Intensiv and Galle-Schild report types
Adds report_type support across the full stack:
- Backend: REPORT_TYPES mapping, fallgruppen filter in all 5 sheet
  calculations, dynamic Excel columns, report_type DB column with
  Alembic migration 007
- Frontend: report type dropdown in generation form, type column in
  reports table, dynamic fallgruppen in ReportViewer

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 12:47:59 +00:00
3bbf5bf51a fix: hide Kontakt section entirely for non-admin users
Kontakt fields (strasse, plz, ort, email, etc.) should only be visible
to admins, not to DAK employees even with an active disclosure. Move
visibleTo: 'admin' from field-level to section-level so the entire
Kontakt section is hidden like Falldetails, Unterlagen, etc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 11:18:26 +00:00
5f957ee8ed fix: mask contact fields for non-admin users, require disclosure for visibility
- Add strasse, plz, ort, email, telefonnummer, mobiltelefon, ansprechpartner
  to SENSITIVE_FIELDS in backend (nullified without disclosure)
- Add visibleTo: 'admin' to all Kontakt fields in frontend fieldConfig
- Consolidate _utcnow_naive() usage across all disclosure service functions
  for consistent naive datetime handling with MySQL

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 11:13:32 +00:00
d900d7864b feat: hide operational sections from DAK employees in case detail
DAK-Mitarbeiter now only see: Bearbeiten, Personendaten anfordern,
Fall-ID, CRM-Ticket, Datum, KW/Jahr, Persönliche Daten, Kontakt,
and ICD-Code entry. Hidden: Falldetails, Unterlagen, Gutachten,
Status, Abrechnung, status badges, and coding info.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 11:01:25 +00:00
28e4dc4333 fix: allow reactivating rejected disclosures in admin view
"Wieder aufleben" now also works for rejected disclosures, setting
status to approved with a new 24h window. Both buttons (reactivate
and delete) now appear for rejected and expired/revoked disclosures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 08:45:26 +00:00
78ae11fb99 feat: add reactivate and delete buttons for admin disclosure view
After revoking or expiry, admins now see "Wieder aufleben" (reactivate
with new 24h window) and "Verwerfen" (hard delete) buttons. Rejected
disclosures also show "Verwerfen".

Backend: PUT .../reactivate and DELETE endpoints for admin disclosures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 08:25:46 +00:00
547bfa3ea5 feat: add re-request and delete buttons for inactive disclosures
DAK employees now see "Erneute Anfrage" (opens dialog with pre-filled
reason) and "Verwerfen" (hard delete) buttons for expired, revoked,
or rejected disclosure requests on their My Disclosures page.

Backend: new DELETE /cases/disclosure-requests/{id} endpoint.
Frontend: new hooks useDeleteDisclosure, useRequestDisclosure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 08:11:08 +00:00
1bedbcf243 fix: resolve TypeError in disclosure revoke due to naive/aware datetime comparison
PyMySQL returns naive datetimes from MySQL DATETIME columns, but
revoke_disclosure() compared them with timezone-aware datetime.now(timezone.utc),
causing an unhandled TypeError (not caught by except ValueError) and a 500 error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 07:57:59 +00:00
95e84a6978 fix: filter report data by max KW when generating reports
Previously, generate_full_report() ignored the kw parameter for data
filtering — it was only stored as metadata. This caused all reports to
contain data up to the latest available KW, making historical reports
(e.g., for KW 8) identical to the current one.

Now all 5 sheet calculation functions accept an optional max_kw parameter.
When generating a report for a specific KW, only cases with kw <= max_kw
are included. Dashboard and vorjahr callers are unaffected (max_kw=None).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 23:16:20 +00:00
4cd52dd0b2 fix: correct double /api/ prefix in report download URL
The download function used `/api/reports/download/{id}` as the URL for
the axios instance which already has `baseURL: '/api'`. This resulted in
requests to `/api/api/reports/download/{id}`, causing nginx to serve
the SPA index.html (status 200, text/html) instead of proxying to the
backend. The HTML was then saved as .xlsx, making Excel unable to open it.

Fix: Use `/reports/download/{id}` for axios (which prepends baseURL)
and keep the full `/api/reports/download/{id}` for the window.open fallback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 23:10:12 +00:00
dbb5afaeb9 feat: add inline report viewer with 5-tab sheet display
- Backend: GET /reports/{id}/data endpoint returns stored report JSON
- Frontend: ReportViewer component renders all 5 Excel sheets as tabs
  (KW gesamt, Fachgebiete, Gutachten, Therapieänderungen, ICD onko)
- ReportsPage: clickable rows with inline expansion to view reports
- Empty KW rows filtered, summary row at bottom, German labels
- Download button still available alongside inline view

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 22:57:35 +00:00
32cee4d30d feat: add KPI links, My Disclosures page, and extend Admin Disclosures
- Dashboard KPI cards are now clickable with role-based links
- New GutachtenStatistikPage placeholder at /gutachten-statistik
- New "Meine Freigaben" page for DAK-Mitarbeiter to view/revoke own disclosures
- Backend: GET /cases/my-disclosure-requests, PUT /cases/disclosure-requests/{id}/revoke
- Admin Disclosures page: full history with status tabs and revoke capability
- Backend: PUT /admin/disclosure-requests/{id}/revoke, default shows all statuses
- Sidebar: "Meine Freigaben" entry for dak_mitarbeiter role

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 22:19:46 +00:00
4504d4300f fix: remove registration link from login page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:58:01 +00:00
837dc56d84 fix: remove unused imports in test files (build fix)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:47:26 +00:00
77805191cf test: add Playwright E2E tests (auth, dashboard, cases, admin)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:44:25 +00:00
edf30c02ec test: add ProtectedRoute tests and remaining page tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:40:25 +00:00
10524a471d test: add CasesPage integration tests (list, filter, detail)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:36:12 +00:00
ba3f930e4d test: add page tests for AdminUsers, Reports, Login
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:32:30 +00:00
e7f7817ebb test: add page tests for Dashboard, Disclosures, AdminAudit
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:27:05 +00:00
36ffe43f18 test: add hook tests for useNotifications and useReports
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:23:15 +00:00
e67fe73da7 test: add hook tests for useDisclosures, useAuditLog, useUsers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:21:27 +00:00
6ede0d93ed test: add hook tests for useDashboard and useCases
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:19:20 +00:00
159ac0a26c test: add service tests (api, authService, disclosureService)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:15:37 +00:00
f14fa0d5f2 feat: add test utilities (renderWithProviders, renderHookWithProviders)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:10:29 +00:00
0416035ce9 feat: add MSW mock server, handlers, and test data
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:08:55 +00:00
8b30be0dcb feat: add Vitest testing infrastructure
Install vitest, @vitest/coverage-v8, jsdom, @testing-library/react,
@testing-library/jest-dom, @testing-library/user-event, and msw.
Create vitest.config.ts with jsdom environment, path aliases, and
coverage configuration. Add test scripts to package.json and
vitest/globals types to tsconfig.app.json.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:05:50 +00:00
75ddadc1f5 docs: add frontend testing implementation plan (13 tasks, ~155 tests)
Detailed task-by-task plan for Vitest + MSW + Playwright test infrastructure
covering hooks, services, page integration tests and E2E browser tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:02:34 +00:00
5d65cb3bcd docs: add frontend testing design (Vitest + MSW + Playwright)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 20:56:41 +00:00
a2b8d476b2 fix: hide Fallgruppen with 0 entries from pie chart
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 20:42:03 +00:00
8038c6e50d feat: make DAK logo clickable, links to dashboard
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 19:08:24 +00:00
061811ce17 fix: increase DAK logo to h-18 in sidebar
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:56:40 +00:00
ddeddeb083 fix: enlarge logo in sidebar, move DAK Portal title to header
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:55:02 +00:00
31c1d63ed7 fix: increase DAK logo size in sidebar
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:50:27 +00:00
617e5c2ae7 fix: move DAK logo from header to sidebar
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:47:34 +00:00
2c1b064373 feat: add DAK logo to header
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:40:07 +00:00
657a1abcaf refactor: migrate CasesPage and useInlineEdit to TanStack Query
Replace manual useEffect data fetching with useCases/usePendingIcdCases
query hooks. Replace direct API calls in useInlineEdit with useCaseUpdate
and useKvnrUpdate mutations. Use useIcdUpdate for ICD saving. Remove
onCaseSaved callback prop drilling — mutations auto-invalidate the cache.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:36:08 +00:00
150be9183c refactor: migrate ReportsPage to TanStack Query
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:31:59 +00:00
29b54e58a2 refactor: migrate useNotifications to TanStack Query
Replace manual useState/useEffect/setInterval polling with useQuery
(refetchInterval: 60s) and useMutation for markAsRead/markAllAsRead.
Public API remains identical so consumers need no changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:30:01 +00:00
5920986c02 refactor: migrate AdminUsersPage to TanStack Query
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:27:17 +00:00
1b4aebfb8d refactor: migrate AdminAuditPage to TanStack Query
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:25:32 +00:00
1de2f7274d refactor: migrate DisclosuresPage to TanStack Query
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:23:46 +00:00
4b4af6b42d refactor: migrate DashboardPage to TanStack Query
Replace manual useState/useEffect data fetching with useDashboard hook
that uses TanStack Query for automatic caching, refetching, and loading
state management.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:21:33 +00:00
28ad5c09ad feat: add TanStack Query with QueryClientProvider
Install @tanstack/react-query v5 and wrap the app with
QueryClientProvider as foundation for server-state management.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:18:37 +00:00
62ee46fa3e docs: add state management implementation plan (9 tasks, TanStack Query)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:16:20 +00:00
d4420500e5 docs: add state management refactoring design (TanStack Query)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:11:55 +00:00
99767fe6fe fix: replace favicon with updated version
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 17:56:23 +00:00
773d5c6e7a feat: add custom favicon for DAK Zweitmeinungs-Portal
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 17:52:19 +00:00
56c0c6e662 fix: remove patient names from coding template and restrict to admin
- Remove Nachname/Vorname columns from ICD coding template (DSGVO)
- Restrict /cases/coding-template endpoint to admin-only
- ICD import reads last column for backwards compatibility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 17:20:28 +00:00