Commit graph

61 commits

Author SHA1 Message Date
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
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
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
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
1612d449c0 fix: make nachname nullable in CaseResponse to support data masking
CaseResponse.nachname was required (str) but the masking function sets
it to None for dak_mitarbeiter. This caused Pydantic validation errors
(500) making the case list empty for non-admin users.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:24:56 +00:00
31a2d5a355 feat: add disclosure admin route and sidebar entry
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:14:14 +00:00
810a13b2d8 feat: add admin disclosures page for reviewing data access requests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:13:13 +00:00
62a56f3fc9 feat: add disclosure request UI and field visibility for dak_mitarbeiter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:11:47 +00:00
f2219b487b feat: hide personal data columns for dak_mitarbeiter in case list
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:09:43 +00:00
3e9448ab33 feat: add disclosure types and service functions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:08:38 +00:00
480f851836 fix: dashboard weekly chart shows correct stacked breakdown
Change stacked bar chart from erstberatungen+unterlagen+gutachten
(overlapping, incorrect) to ablehnungen+keine_rm+gutachten (disjoint
categories that sum to total cases per KW, matching Excel Sheet 1).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 11:12:30 +00:00
5f7b4c6e1d feat: add /account route, sidebar entry and header link
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 09:48:43 +00:00
45cadd07ce feat: add AccountPage with Profile, Security, and MFA tabs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 09:46:52 +00:00
832f5c0a63 feat: add profile/avatar/MFA types and service functions
Extend User and UserResponse interfaces with first_name, last_name,
display_name, avatar_url fields. Add ProfileUpdatePayload,
ChangePasswordPayload, MFASetupResponse, MFAVerifyPayload types.
Add authService functions for profile update, avatar upload/delete,
password change, and MFA setup/verify/disable. Add refreshUser to
AuthContext so components can re-fetch user data after changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 09:42:46 +00:00
7e9373a6d0 fix: use sentinel value for empty Radix Select option to prevent crash
Radix UI Select.Item does not allow empty string values. The Anrede
dropdown used value="" for the empty option, causing the entire React
app to crash when entering edit mode. Use '__none__' sentinel value
instead and convert to null on selection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 12:59:32 +00:00