Add staff reliability stats & shift location

Introduce staff reliability statistics and location fields across domain, data, and UI. Changes include:

- New API endpoint StaffEndpoints.profileStats ('/staff/profile/stats').
- New domain entity StaffReliabilityStats with JSON (de)serialization and export.
- Profile repository: getReliabilityStats implementation and interface addition.
- New GetReliabilityStatsUseCase and DI registration in StaffProfileModule.
- ProfileCubit/state: load and store reliabilityStats; UI wired to display ReliabilityStatsCard and ReliabilityScoreBar using state values.
- Coverage/shift updates: Added AssignedWorker.hasReview to track if a worker was reviewed; added locationName/locationAddress to ShiftWithWorkers and show location in ShiftHeader; hide rate button if worker.hasReview.
- Clock-in handling: treat backend ALREADY_CLOCKED_IN (409) as idempotent by re-fetching attendance and emitting success when appropriate.

These changes wire backend stats through repository/usecase/cubit to the profile UI and add shift location and review-awareness to client views.
This commit is contained in:
Achintha Isuru
2026-03-19 10:53:37 -04:00
parent 88a319da4f
commit 493891eea0
15 changed files with 247 additions and 37 deletions

View File

@@ -99,6 +99,7 @@ export 'src/entities/profile/accessibility.dart';
// Ratings
export 'src/entities/ratings/staff_rating.dart';
export 'src/entities/ratings/staff_reliability_stats.dart';
// Home
export 'src/entities/home/client_dashboard.dart';