Commit graph

86 commits

Author SHA1 Message Date
c0f78278e4 feat: hide Fall-ID column and simplify export for DAK-Mitarbeiter
Fall-ID is redundant for DAK staff since KVNR is shown separately.
Export now only includes Datum, KVNR, Fallgruppe, ICD, Gutachten, Status.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 15:08:29 +00:00
7a372922e6 fix: show admin dashboard cards even when no data exists for selected year
Previously the Abrechnungsstatus and Top 10 Gutachter cards were hidden
when no data existed (e.g. gutachter field unpopulated in 2026). Now both
cards render with a "no data" placeholder message instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 16:01:29 +00:00
42fd1808c4 feat: add admin-only billing status donut and top gutachter charts to Dashboard
Extends DashboardKPIs with total_abgerechnet/pending_abrechnung. Adds
new GET /reports/dashboard/top-gutachter endpoint (admin-only). Frontend
shows Abrechnungsstatus donut + Gutachter-Verteilung progress bars in a
new third row, visible only to admins.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 15:55:30 +00:00
f3846813a4 feat: add saved filter presets for case list
Users can save frequently used filter combinations (year, fallgruppe,
ICD status, search) as named presets. Stored server-side in new
filter_presets table (max 10 per user). Star-icon Popover on CasesPage
to load, save, or delete presets. TanStack Query hooks for CRUD.

New files: FilterPreset model, migration 009, API router, schemas,
useFilterPresets hook.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 15:13:20 +00:00
d5db84d93f feat: add self-service password reset via email
Adds "Passwort vergessen?" to login page with email-based password
reset flow. Backend generates secure token (SHA-256 hashed, 1h expiry),
sends reset link via SMTP, and validates on submission. Includes rate
limiting (3 requests/hour/email), audit logging, and account unlock
on successful reset. New ResetPasswordPage with password confirmation.

New DB table: password_reset_tokens (migration 008).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 14:56:07 +00:00
002021d7c7 feat: add Excel export for filtered case list
New GET /cases/export endpoint generates .xlsx with openpyxl using the
same filters as the case list (year, fallgruppe, ICD status, search).
Role-aware columns: admins see patient names, DAK staff does not.
Frontend adds a Download button next to the filter bar with loading
state. Refactors shared query logic into _build_case_query helper.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 14:43:00 +00:00
eb39346f02 feat: add batch ICD input mode to ICD page
Adds a Switch toggle for "Batch-Modus" on the ICD page that enables
inline ICD code entry directly in the table. Features: Enter to save,
Escape to cancel, Tab to navigate, visual feedback (green/red border,
spinner, checkmark/error icon with tooltip).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 14:07:33 +00:00
73b0d6761c feat: add year-over-year comparison to Dashboard KPI cards
Dashboard endpoint now returns prev_kpis (previous year's KPIs) alongside
current KPIs. KpiCard component shows percentage change with colored trend
indicators (green up, red down, grey neutral). Also marks completed items
in todo.md (notification center, dark mode toggle were already implemented).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 13:15:05 +00:00
5da1e523d3 feat: implement Gutachten-Statistik page with KPIs and charts
Add full statistics page replacing placeholder: 4 KPI cards (total, Bestätigung,
Alternative, Uncodiert), stacked bar chart for gutachten types per KW, donut chart
for type distribution, grouped bar chart for therapy changes per KW, and horizontal
bar chart for therapy change reasons. Includes new backend endpoint and service
function combining sheet3/sheet4 data with KPI aggregation. Also adds feature
roadmap todo.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 12:37:08 +00:00
bfb0e4bfdf docs: add yearly comparison and top ICD to Anleitung page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 12:24:04 +00:00
cb73cf5461 feat: add yearly KW comparison chart and top 10 ICD box to Dashboard
Backend: two new endpoints /reports/dashboard/yearly-comparison and
/reports/dashboard/top-icd for multi-year KW case counts and ICD
frequency aggregation.

Frontend: grouped bar chart comparing KW across years (2022+) and
a ranked top 10 ICD list with progress bars on the Dashboard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 12:11:51 +00:00
1e3f705ed3 feat: add admin-only guide sections to Anleitung page
Add 8 admin-specific accordion sections (CSV import, ICD import,
Coding queue, Disclosure management, Users, Invitations, Audit log,
Report generation) conditionally rendered via useAuth().isAdmin.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 12:03:28 +00:00
61f95483d6 feat: add Anleitung page with step-by-step guides for all portal features
New guide page accessible via sidebar with accordion-based instructions
covering Dashboard, Cases, ICD input, Disclosures, Reports, Weekly
Overview, and Account management. Includes a glossary of key terms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 11:48:52 +00:00
2e41242c9e feat: add year filter to Coding queue
Add jahr parameter to the coding queue API endpoint and frontend
filter, allowing admins to filter the coding queue by year.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:37:04 +00:00
d5b357b60d fix: improve CodingPage filter UX and prevent race conditions
- Show grand total count (data.total) instead of items.length
- Display active fallgruppe filter label prominently
- Add AbortController to cancel stale requests on rapid filter changes
- Clarify badge to show "X / Y auf dieser Seite codiert"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:28:23 +00:00
35b9d5a7c9 fix: position legal links below login card instead of beside it
Add flex-col to login page container so Impressum/Datenschutz
links render as a proper footer below the login card.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:09:43 +00:00
551212b217 feat: add Impressum and Datenschutz links on login page
Legal links shown below the login card, opening iframe dialog
to keep users on the page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:06:23 +00:00
4dae529520 feat: add Impressum and Datenschutz links in sidebar
Legal links at sidebar footer open content in an iframe dialog,
keeping users within the portal instead of navigating away.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 16:59:06 +00:00
ad0bcaf8c1 feat: add tooltips and explanatory text for DAK-Mitarbeiter pages
Add contextual tooltips on table headers, KPI cards, status badges,
and action buttons across Dashboard, Cases, Wochenübersicht, Reports,
and My Disclosures pages. Wrap global TooltipProvider in App.tsx.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 16:12:59 +00:00
899c125a62 fix: show individual case data in Wochenübersicht preview instead of aggregated summaries
Preview now mirrors the Excel export content: KVNR, Datum, x-markers
for Erstgespräch/Abbruch/Unterlagen/Gutachten/FG, and ICD-10 per case,
grouped by KW blocks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 15:32:30 +00:00
27b3810250 feat: add inline preview for Wochenübersicht reports
- Backend stores per-KW summary in report_data (count, ICD status, FG split)
- WochenuebersichtViewer component shows expandable KW table with totals
- Expand/collapse pattern matching ReportsPage (ChevronRight/Down, useReportData)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 15:26:20 +00:00
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
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