refactor(ping-feature): remove deprecated PingFeature files and legacy implementations
Deleted obsolete files and models from the `ping-feature` module, including redundant enums, the old `PingApiClient`, and legacy view models. Simplified the module by consolidating its implementation with the new Koin-based DI and shared client architecture. Cleaned up unused code and improved module maintainability.
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
---
|
||||
type: Report
|
||||
status: FINAL
|
||||
owner: Frontend Expert
|
||||
date: 2026-01-19
|
||||
tags: [frontend, refactoring, clean-architecture, ping-feature]
|
||||
---
|
||||
|
||||
# 🚩 Statusbericht: Frontend Refactoring (19. Jänner 2026)
|
||||
|
||||
**Status:** ✅ **Erfolgreich abgeschlossen**
|
||||
|
||||
Wir haben die vom Lead Architect kritisierte Fragmentierung im Frontend behoben und das Ping-Feature auf eine saubere **Clean Architecture** migriert.
|
||||
|
||||
### 🎯 Erreichte Ziele (DoD)
|
||||
|
||||
1. **ViewModel-Fragmentierung behoben:**
|
||||
* Die zwei parallelen `PingViewModel`-Implementierungen wurden konsolidiert.
|
||||
* Das neue ViewModel (`at.mocode.ping.feature.presentation.PingViewModel`) vereint API-Calls und Sync-Logik.
|
||||
* Das alte Package `at.mocode.clients.pingfeature` wurde **vollständig entfernt**.
|
||||
|
||||
2. **Clean Architecture Struktur:**
|
||||
* Das Ping-Feature folgt nun strikt der neuen Struktur:
|
||||
* `data`: `PingApiKoinClient`, `PingEventRepositoryImpl`
|
||||
* `domain`: `PingSyncService` (neu eingeführt zur Entkopplung)
|
||||
* `presentation`: `PingViewModel`, `PingScreen`
|
||||
* `di`: `pingFeatureModule`
|
||||
|
||||
3. **UI Integration:**
|
||||
* Der `PingScreen` wurde aktualisiert und enthält nun einen **"Sync Now"-Button** sowie eine Statusanzeige für den Sync-Vorgang.
|
||||
|
||||
4. **Test-Stabilität:**
|
||||
* Die Unit-Tests (`PingViewModelTest`) wurden massiv verbessert.
|
||||
* Wir nutzen nun **manuelle Fakes** (`FakePingSyncService`, `TestPingApiClient`) statt Mocking-Frameworks, um 100% JS-Kompatibilität zu gewährleisten.
|
||||
* Race-Conditions in den Tests wurden durch korrekte Nutzung von `StandardTestDispatcher` und `advanceUntilIdle()` behoben.
|
||||
* Namenskonflikte bei `Clock` wurden durch explizite Imports (`kotlin.time.Clock`) gelöst.
|
||||
|
||||
### 🛠️ Technische Details
|
||||
|
||||
* **Dependency Injection:** Das `pingFeatureModule` stellt alle Komponenten bereit und nutzt den zentralen `apiClient` aus dem Core.
|
||||
* **Sync-Abstraktion:** Ein `PingSyncService` Interface wurde eingeführt, um das ViewModel vom generischen `SyncManager` zu entkoppeln. Dies erleichtert das Testen und zukünftige Erweiterungen.
|
||||
* **Build:** Der Build ist **grün** (inkl. JS/Webpack und JVM Tests).
|
||||
|
||||
### 📝 Empfehlung für Folgemaßnahmen
|
||||
|
||||
* **Members & Auth Feature:** Diese sollten bei der nächsten Bearbeitung ebenfalls auf die neue Struktur (`at.mocode.{feature}.feature.*`) migriert werden.
|
||||
* **Sync Up:** Aktuell testen wir nur "Sync Down" (Server -> Client). Für einen vollständigen Offline-Test sollte eine "Create Ping"-Funktion (Sync Up) ergänzt werden, sobald das Backend dies unterstützt.
|
||||
|
||||
---
|
||||
|
||||
**Fazit:** Das Ping-Feature ist nun die **"Goldene Vorlage"** für alle kommenden Features.
|
||||
Reference in New Issue
Block a user