Files
erp-nutzfahrzeuge/.a0/worklog.md
T
Leopoldadmin 74b5e6afb8 feat(T02): vehicle management + mobile.de push + vehicle UI
- Vehicle model: 25+ fields, 5 vehicle types, soft-delete
- Vehicle CRUD: 7 API endpoints with JWT auth, filter/sort/paginate
- mobile.de: push/update/delete listings, field mapping, retry logic
- MobileDeListing model for sync status tracking
- Frontend: VehicleList, VehicleForm, VehicleDetail, MobileDeStatus
- 73 backend tests (82% coverage), 16 frontend tests
2026-07-14 12:03:19 +02:00

71 lines
3.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Worklog - ERP Nutzfahrzeuge
## 2026-07-13
- Phase 1 (Discovery + UI Design): Abgeschlossen
- requirements.md erstellt (703 Zeilen)
- UI-Prototyp v8d erstellt und auf webspace.media-on.de gepublished
- component_inventory.md erstellt
- Phase 2 (Architektur): Abgeschlossen
- architecture.md erstellt (1162 Zeilen, 14 ADRs)
- task_graph.json erstellt (8 Tasks T01-T08)
- AGENTS.md erstellt
- Git: 2 Commits auf main (afe6d0a, be5a339), auf Forgejo gepusht
- .gitignore erstellt
- Bereit für Phase 3 (Implementation), wartet auf User-Freigabe
## T01 Auth + User Management + RBAC + Frontend + i18n (2026-07-14)
### Backend
- config.py: Pydantic BaseSettings, alle Env-Vars (DATABASE_URL, REDIS_URL, JWT_SECRET, CORS_ORIGINS, etc.)
- database.py: Async SQLAlchemy engine, session factory, Base, init_db/drop_db
- models/user.py: User mit UUID PK, email, password_hash, role (Enum), language, is_active, timestamps
- schemas/user.py: LoginRequest, TokenResponse, RefreshRequest, UserCreate/Update/Response, UserListResponse
- utils/jwt.py: create_access_token, create_refresh_token, decode_token, verify_access/refresh_token
- services/auth_service.py: hash_password, verify_password, authenticate_user, generate_token_pair, refresh_access_token, create_user, list_users, update_user, deactivate_user
- dependencies.py: get_pagination, get_current_user (JWT extraction), require_role (RBAC)
- routers/auth.py: POST /login, POST /refresh, GET /me
- routers/users.py: GET / (list paginated), POST / (create), PUT /:id (update), DELETE /:id (soft-delete) alle admin-only
- main.py: FastAPI app, CORS middleware, /api/v1 prefix, /health endpoint
- tests/: conftest.py (async fixtures, PostgreSQL), test_auth.py (12 tests), test_users.py (14 tests), test_health.py (3 tests), test_auth_service.py (21 tests)
- requirements.txt, .env.example, pytest.ini, .coveragerc
### Frontend
- package.json, tsconfig.json, next.config.js, tailwind.config.ts, vitest.config.ts
- app/layout.tsx, app/page.tsx, app/globals.css (design tokens als CSS vars)
- app/(auth)/layout.tsx (I18nProvider + ToastProvider wrapper)
- app/(auth)/login/page.tsx (Login-Form mit Validation, API call, Toast on error)
- lib/api.ts (fetch wrapper mit auto-refresh, login, getCurrentUser, listUsers, createUser, deleteUser)
- lib/auth.ts (useAuth hook, useRequireAuth)
- lib/i18n.tsx (I18nProvider, useI18n, DE/EN translation)
- components/ui/: Button, Input, Card, Table, Modal, Toast (alle 6 Komponenten)
- messages/de.json (31 keys), messages/en.json (31 keys)
- tests/setup.ts, tests/auth.test.tsx (5 tests), tests/i18n.test.tsx (7 tests)
### Test Results
- Backend: 50/50 passed, 88% total coverage
- Frontend: 12/12 passed, Next.js build success
- test_report.md erstellt
## T02 Vehicle Management + mobile.de Push + Vehicle UI (2026-07-14)
### Backend
- models/vehicle.py: Vehicle + MobileDeListing models with UUID PK, soft-delete, all fields per spec
- schemas/vehicle.py: VehicleCreate/Update/Response/ListResponse, MobileDeStatusResponse, MobileDePushResponse with auto-compute power_hp
- utils/mobilede_mapping.py: map_fields() converts Vehicle to mobile.de Ad format
- services/vehicle_service.py: CRUD with pagination, filtering, sorting, soft-delete
- services/mobilede_service.py: push/update/delete listing, get status, retry (max 3)
- routers/vehicles.py: 7 endpoints (list, create, detail, update, delete, mobile-de push, mobile-de status)
- config.py: Added MOBILE_DE_API_KEY, MOBILE_DE_SELLER_ID
- main.py: Registered vehicles router
### Frontend
- lib/vehicles.ts: Full API client with typed interfaces
- components/vehicles/: VehicleList, VehicleForm, VehicleDetail, MobileDeStatus
- app/[locale]/fahrzeuge/: list page, neu (create) page, [id] detail page
- tests/vehicles.test.tsx: 16 tests
### Test Results
- Backend: 73/73 pytest passed, 82% total coverage
- Frontend: 16/16 vitest passed
- test_report.md updated