Commit Graph

26 Commits

Author SHA1 Message Date
08824290ff Phase B: Token-Provider und AuthBloc robust gegen Storage-Plugin-Fehler
Beobachtung: Nach 'flutter_secure_storage' frisch dazugepackt ohne
Cold-Restart kam eine MissingPluginException auf dem AuthBloc-Stream
durch (read auf channel plugins.it_nomads.com/flutter_secure_storage)
und hat den ganzen Bloc-Event-Loop mitgerissen.

Fix:
- KeycloakOidcTokenProvider.restoreSession / _persistRefreshToken /
  logout fangen Plugin-Exceptions ab und loggen sie über debugPrint,
  statt sie hochzureichen. Restore-Pfad endet sauber mit 'kein Restore
  möglich', Login-Pfad hält den Token in Memory weiter.
- AuthBloc._handleRestore mit eigener try/catch als zweite Schutzschicht
  für jeden anderen Fehler aus dem Provider.

Bestehender Cold-Restart-Workaround (App stoppen + flutter run) für die
ursprüngliche MissingPluginException bleibt natürlich nötig — diese
Änderung sorgt nur dafür, dass künftige Storage-Probleme (Keychain
zerschossen, Restore-Backup, …) nicht die Auth komplett killen.
2026-05-14 23:04:12 +02:00
6d7e58fc0f Phase B: Keycloak OIDC (PKCE) statt Cookie-Session-Login
App-Code:
- KeycloakOidcTokenProvider: PKCE-Login via flutter_appauth, Refresh via
  Refresh-Token aus flutter_secure_storage, Session-Restore beim
  App-Start, Logout.
- AuthSessionEvent als Provider→Bloc-Brücke (LoggedIn/LoggedOut/
  SessionExpired) auf einem Broadcast-Stream.
- AuthBloc komplett umgebaut: nimmt jetzt den KeycloakOidcTokenProvider
  statt UserInfoService, mappt eingehende Provider-Events auf eigene
  Zustände. Authenticated.fromClaims() liest personalnummer + Name aus
  dem ID-Token-Payload.
- LoginPage: kein Browser+Deep-Link mehr — Button feuert
  LoginRequested, der Provider übernimmt den restlichen Flow.
- network_locator: produktiver KeycloakOidcTokenProvider, doppelt
  registriert (KeycloakOidcTokenProvider für AuthBloc,
  AuthTokenProvider für Interceptor).
- Auth-State trägt zusätzlich personalnummer/displayName/email; das
  Legacy-User-Objekt + sessionId bleiben temporär drin, damit die
  alten ERPframe-Services (Phase D) noch kompilieren.

Plattform-Setup:
- Android: appAuthRedirectScheme=holzleitner in build.gradle.kts,
  NetworkSecurityConfig erlaubt HTTP zu localhost/10.0.2.2/127.0.0.1.
- iOS: holzleitner als URL-Scheme im Info.plist, ATS-Ausnahme für
  localhost (HTTP-Keycloak im Dev-Setup).

Out of scope:
- Keine echte App-Run-Smoke — kommt mit dem User-Test.
- iOS-pod-install läuft beim ersten 'flutter run ios' automatisch.
- Old ERPframe-Services bleiben aktiv und werfen ab jetzt 401 (kein
  Cookie-Session-Token mehr) — wird in Phase D entfernt.
2026-05-14 22:59:36 +02:00
456fb59668 Phasenbasierte Lieferübersicht + Beladen-Flow, plus Migrationsplan für Rust-Backend
UI-Restructuring:
- TabBar in scan_page durch dedizierte Phasen ersetzt: Sortieren / Beladen / Ausliefern
- PhaseBloc + PhaseService leiten Phase aus Tour-/Item-States ab
- DeliverySelectionPage (ab 2 Autos) und DeliverySortPage als eigene Flows
- LoadingOverviewPage / LoadingCustomerPage für die Beladephase
- PhaseStepper-Widget im Home für Phasen-Anzeige
- Lager-Differenzierung (Standardlager 0 vs. Außenlager) via WarehouseBadge

Process-Stubs:
- ProcessRepository für Hold/Cancel/Sort/Assign-Flows (stub, bereit für Backend-Anbindung)

Doku:
- docs/BACKEND_MIGRATION.md: Phasenplan für Umstellung auf das neue
  Rust-Backend (OpenAPI-Generator, Keycloak OIDC, Clean-Arch-Layering)
2026-05-14 22:27:56 +02:00
ac6b03227d Added components to article 2026-05-11 17:12:05 +02:00
2470299a10 BIG FAT 2026-04-28 13:03:09 +02:00
de8668c11a MEGA BIG FAT 2026-04-28 13:02:40 +02:00
8cf0ea4e9a Added fail pages to retry the failed operation to delivery overview, notes and cars. Furthermore, I added better handling if the user is finished scanning articles. 2026-01-29 16:45:29 +01:00
366a3560dc Implemented new custom sort and separated the sorted view for each car 2026-01-27 00:21:23 +01:00
2436177c95 Implemented new set article mechanism for unscannable articles 2026-01-10 20:20:28 +01:00
1848f47e7f Adjusted appearance of car management page and removed debug prints 2026-01-09 13:12:03 +01:00
3b5d58eb9d Fixed a bug where the current payment method is duplicated in the payment selection list 2026-01-09 13:02:38 +01:00
da0f77e35d Added separate car loaded event 2026-01-09 13:02:15 +01:00
c2f574014a Enhanced discount input. It was possible to remove a discount that has not been saved yet. 2026-01-09 12:43:16 +01:00
1d6c62a392 Removed unused imports and moved tour bloc to delivery to be shared by overview and detailed view 2026-01-09 12:24:31 +01:00
ecf8745762 Finalized sorting in delivery overview 2026-01-09 12:16:52 +01:00
b481a45afc Fixed missing loading spinner due to seeded streams in note repository. 2026-01-08 15:59:45 +01:00
6eafb0fab0 Added the payment options to the summary and enhanced usability handling with delivery options 2026-01-08 14:11:01 +01:00
ffdd7fa0ff Implemented note templates and enhanced usability by adjusting the dimension of the note dialogs 2026-01-08 14:10:21 +01:00
6a53d2d716 Enhanced signature step and adjusted note bloc 2026-01-07 16:07:24 +01:00
622967e5c1 Finished custom sorting of deliveries 2026-01-07 15:19:34 +01:00
9111dc92db Added Streams to TourRepository 2026-01-03 01:29:21 +01:00
edb8676f5a Added custom tour ordering 2025-12-20 21:00:33 +01:00
0c61f65961 Removed unused imports for old docuframe SDK and fixed unneccesary docuframe exceptions on try/catch block 2025-11-28 20:49:06 +01:00
0150614ef5 Sign page: added user check for accepting notes of a delivery 2025-11-28 20:46:03 +01:00
7ea9108f62 Implemented settings, new scan, enhanced UI/UX 2025-11-04 16:52:39 +01:00
b19a6e1cd4 Initial draft 2025-09-20 16:14:06 +02:00