Commit graph

7 commits

Author SHA1 Message Date
518de3da27 feat: auth system — login, register, refresh, MFA, domain whitelist
Add complete authentication layer:
- Pydantic v2 schemas for auth requests/responses and user representation
- Auth service with login (account locking, MFA), registration (invitation
  tokens + domain whitelist), token management, MFA setup/activation, and
  password change
- FastAPI router with 8 endpoints: login, register, refresh, logout,
  mfa/setup, mfa/verify, change-password, me
- Router registered in main.py under /api/auth

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 07:46:04 +00:00
84d11822e0 feat: CRM CSV parser with pipe-delimited contact parsing
Parse CRM CSV exports (UTF-8-BOM, comma-delimited) with:
- Pipe-delimited Hauptkontakt field (Nachname|Vorname|Geburtsdatum|KVNR)
- German date formats (DD.MM.YYYY, DD.MM.YY, HH:MM)
- Modul-to-Fallgruppe mapping
- Graceful handling of missing KVNR, bad dates, empty fields, spam rows
- 19 tests (synthetic + all 4 real CSV files)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 07:45:34 +00:00
178d40d036 feat: JWT auth, bcrypt, MFA, dependency injection, security tests
Add core security layer:
- security.py: password hashing (bcrypt), JWT access/refresh tokens,
  SHA-256 token hashing, TOTP MFA (generate, verify, provisioning URI),
  plus passlib/bcrypt 5.x compatibility patch
- dependencies.py: FastAPI deps for get_current_user (Bearer JWT) and
  require_admin (role check)
- exceptions.py: domain-specific HTTP exceptions (CaseNotFound,
  DuplicateCase, InvalidImportFile, ICDValidation, AccountLocked,
  InvalidCredentials)
- test_security.py: 9 tests covering all security functions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 07:41:35 +00:00
e0ca8c31c3 feat: utility functions — fallgruppe mapping, KW calc, ICD/KVNR validation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 07:41:09 +00:00
4649f7a082 feat: Alembic migrations, initial schema
- Initialize Alembic with MySQL/MariaDB-targeted configuration
- Configure env.py to read DB URL from app.config.get_settings()
- Create initial migration (062ccae5457b) for all 11 tables:
  users, refresh_tokens, invitation_links, allowed_domains,
  cases, case_icd_codes, weekly_reports, yearly_summary,
  import_log, audit_log, notifications
- Include all indexes, foreign keys, check constraints, and
  MySQL text prefix index (icd(20))
- Add seed script (scripts/init_db.py) for dak.de domain whitelist
- DB apply deferred: MariaDB on Hetzner 1 not reachable from dev

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 07:33:27 +00:00
e7befe78b6 feat: SQLAlchemy models for users, cases, reports, audit
11 models across 4 files matching the MariaDB schema:
- user.py: User, RefreshToken, InvitationLink, AllowedDomain
- case.py: Case, CaseICDCode
- report.py: WeeklyReport, YearlySummary
- audit.py: ImportLog, AuditLog, Notification

All CHECK constraints, indexes (incl. prefix index), foreign keys,
and server defaults match the SQL DDL specification exactly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 07:28:33 +00:00
5d57b1f349 feat: project scaffolding with FastAPI, config, database connection
- Initialize project structure with backend/app/ package layout
- Add FastAPI app with CORS middleware and health check endpoint
- Add Pydantic Settings config with DB, JWT, SMTP, and app settings
- Add SQLAlchemy database engine and session management
- Add requirements.txt with all dependencies (FastAPI, SQLAlchemy, Alembic, etc.)
- Add .env.example template and .gitignore
- Add empty frontend/ and backend test scaffolding
- Include project specification and design/implementation plans

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