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
This commit is contained in:
+19
-15
@@ -1,27 +1,31 @@
|
||||
# Current Status
|
||||
|
||||
**Task**: T01 – Auth + User Management + RBAC + Base Frontend Layout + i18n Setup
|
||||
**Task**: T02 – Vehicle Management + mobile.de Push + Vehicle UI
|
||||
**Status**: COMPLETED
|
||||
**Date**: 2026-07-14
|
||||
|
||||
## Summary
|
||||
Backend (FastAPI) und Frontend (Next.js 14) vollständig implementiert.
|
||||
Vehicle CRUD API with pagination/filtering/sorting, mobile.de push integration, and full frontend UI implemented.
|
||||
|
||||
## Backend (COMPLETED)
|
||||
- 10 Python-Dateien erstellt (config, database, models, schemas, utils, services, dependencies, routers, main)
|
||||
- 4 Test-Dateien mit 50 Tests – alle bestanden
|
||||
- Coverage: 88% total, auth_service 95%, routers 79-100%
|
||||
- PostgreSQL 18 als Test-DB (kein SQLite)
|
||||
- bcrypt Password-Hashing, JWT HS256, RBAC require_role
|
||||
- Vehicle model: UUID PK, all fields per spec (make, model, fin CHECK len=17, year, first_registration, power_kw, power_hp computed, fuel_type, transmission, color, condition, location, availability, price, vehicle_type, lkw_type, machine_type, body_type, operating_hours, operating_hours_unit, mileage_km, description, timestamps, deleted_at soft-delete)
|
||||
- MobileDeListing model: vehicle_id FK, ad_id, sync_status, synced_at, error_log
|
||||
- 7 API endpoints: GET /vehicles (list+filter+sort+paginate), POST /vehicles (create), GET /vehicles/:id (detail), PUT /vehicles/:id (update), DELETE /vehicles/:id (soft-delete), POST /vehicles/:id/mobile-de/push (202 async), GET /vehicles/:id/mobile-de/status
|
||||
- mobile.de service: push_listing, update_listing, delete_listing, get_listing_status, retry_failed_listing (max 3 retries)
|
||||
- Field mapping: map_fields() converts Vehicle to mobile.de Ad format (vin, firstRegistration YYYY-MM, mileage, price EUR, power, category, bodyType, sellerLocation)
|
||||
- All endpoints require JWT Bearer auth
|
||||
- Config: MOBILE_DE_API_KEY, MOBILE_DE_SELLER_ID env vars added
|
||||
|
||||
## Frontend (COMPLETED)
|
||||
- 6 UI-Komponenten (Button, Input, Card, Table, Modal, Toast)
|
||||
- Login-Page mit Form-Validation und Toast-Error-Handling
|
||||
- i18n mit DE/EN (31 Keys je Sprache)
|
||||
- 12 Vitest-Tests – alle bestanden
|
||||
- Next.js Production Build erfolgreich
|
||||
- VehicleList: Table with filters (search, type, availability, sort), pagination, error handling
|
||||
- VehicleForm: Create/edit form with validation (make, model, fin=17 chars, price>0, vehicle_type), conditional fields
|
||||
- VehicleDetail: All vehicle fields display, delete button, MobileDeStatus embedded
|
||||
- MobileDeStatus: Sync status badge, push button, ad_id, synced_at, error_log display
|
||||
- 3 pages: fahrzeuge list, fahrzeuge/neu create, fahrzeuge/[id] detail
|
||||
|
||||
## Test Evidence
|
||||
- Backend: 50/50 pytest passed, 88% coverage
|
||||
- Frontend: 12/12 vitest passed, Next.js build success
|
||||
- test_report.md erstellt mit vollständigen Ergebnissen
|
||||
- Backend: 73/73 pytest passed, 82% total coverage (vehicle_service 99%, mobilede_service 80%, router 60%)
|
||||
- Frontend: 16/16 vitest passed
|
||||
- test_report.md updated with full results
|
||||
- All mobile.de HTTP calls mocked in tests, no real API calls
|
||||
- Soft-delete verified: deleted_at set, vehicle excluded from list and detail queries
|
||||
|
||||
@@ -45,3 +45,26 @@
|
||||
- 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
|
||||
|
||||
Reference in New Issue
Block a user