Commit Graph

954 Commits

Author SHA1 Message Date
Achintha Isuru
3e5b6af8dc Refactor widgets, add bloc dep
Clean up widget code and update a dependency:

- Remove redundant const qualifiers and tidy widget children in several skeleton/header widgets for consistent style.
- Add super.key to TaxFormsProgressOverview, TaxFormStatusBadge, and AccountCard constructors.
- Simplify AccountCard by consolidating its constructor into a single const declaration.
- Minor fixes: adjust Image.onError parameter, reformat CircleAvatar/Icon construction in edit_profile_page.
- Add bloc ^8.1.4 to staff/authentication pubspec.

These changes are stylistic and aim to improve consistency and constructor patterns across the codebase.
2026-03-18 10:33:19 -04:00
Achintha Isuru
9ee8467632 Refactor widgets & imports; add krow_domain
Add local krow_domain dependency to client, staff apps and client home package. Numerous UI/widget cleanups across features: add const where applicable, use explicit List<Widget> types and List<Widget>.generate, add super.key to constructors, tighten BlocProvider generics, replace some Containers with SizedBox, and simplify InputDecoration/Border constructors. Fix API error handler to return a const UnknownException. Update internal imports to package-style paths (staff_home, staff_payments, staff_main repository interface) and normalize Flutter imports (use material.dart). Add missing braces for early returns in tax form pages. Mostly formatting and small API/typing refactors with no behavioral changes intended.
2026-03-18 10:27:31 -04:00
Achintha Isuru
e471fd12f2 Merge branch 'dev' into 592-migrate-frontend-applications-to-v2-backend-and-database 2026-03-18 10:06:54 -04:00
zouantchaw
1d850811c4 chore(legacy): relocate v1 dataconnect source 2026-03-18 15:04:18 +01:00
Achintha Isuru
c9f7e41cbe refactor(skeletons): update children type annotations and improve consistency in skeleton widgets 2026-03-18 10:01:23 -04:00
Achintha Isuru
0b5254311d feat(api): update DeviceLocation model and clean up AuthRepositoryImpl and BillingPageSkeleton 2026-03-18 10:00:27 -04:00
Achintha Isuru
2c7094bb54 feat: load assigned, pending, and cancelled shifts in parallel for improved performance 2026-03-17 16:18:45 -04:00
Achintha Isuru
42945b3b60 feat: update ReorderWidget layout for responsive design; adjust item dimensions based on screen size 2026-03-17 15:15:18 -04:00
Achintha Isuru
1252211a12 fix: correct clock-in validation logic to check for too early time 2026-03-17 15:03:08 -04:00
Achintha Isuru
cfe8c0bc6c feat: update certificate card to display issuer name if available 2026-03-17 14:55:10 -04:00
Achintha Isuru
a12539ba07 feat: normalize user ID in auth envelope and update hub manager assignment logic 2026-03-17 14:47:01 -04:00
Achintha Isuru
e2d833dc58 feat: update UiNoticeBanner layout; align children to start and adjust description color 2026-03-17 14:37:56 -04:00
Achintha Isuru
de388c9a77 feat: update profile setup and bank account management; enhance API integration and data handling 2026-03-17 14:32:26 -04:00
Achintha Isuru
b6a655a261 feat: enhance API error handling and response structure; introduce ApiException for V2 error codes 2026-03-17 14:15:26 -04:00
Achintha Isuru
d6ddb7829e fix: change saveContacts method to use POST instead of PUT for emergency contacts 2026-03-17 14:00:41 -04:00
Achintha Isuru
e1d30c124b feat: migrate experience management to V2 API; add support for industries and skills 2026-03-17 13:44:48 -04:00
Achintha Isuru
e83b8fff1c refactor: update color definitions and improve UI component structure; handle null safety in repository data fetching 2026-03-17 13:20:04 -04:00
Achintha Isuru
a0d5a18e6f Refactor shift history and my shifts tabs to use a unified ShiftCard widget
- Introduced ShiftCard widget to standardize the display of shift information across different states (assigned, completed, cancelled, pending).
- Removed redundant card implementations (_CompletedShiftCard, MyShiftCard, ShiftAssignmentCard) and replaced them with ShiftCard.
- Updated localization for empty states and shift titles in HistoryShiftsTab and MyShiftsTab.
- Enhanced MyShiftsTab to track submitted shifts locally and show appropriate actions based on shift status.
- Added meta package dependency for improved type annotations.
2026-03-17 13:08:32 -04:00
Achintha Isuru
020c785b6f Cancel background tasks and clear feature scopes
Ensure sign-out cleans up background work and feature state: import BackgroundTaskService and FeatureGate, invoke BackgroundTaskService.cancelAll() inside a try/catch in the sign-out finally block, and call FeatureGate.instance.clearScopes(). Existing client/staff session clearing and handleSignOut() are preserved.
2026-03-17 12:22:09 -04:00
Achintha Isuru
730b298d49 fix: correct time comparison logic in clock-in validation 2026-03-17 12:17:31 -04:00
Achintha Isuru
d12b45a37d Expose parseDouble; fix shift mapping and UI
Rename and expose numeric parser (from _parseDouble to parseDouble) with a doc comment so other modules can reuse it. Update ClockIn repository mapping to populate orderId and prefer clientName for the shift title, and map latitude/longitude using Shift.parseDouble. Remove outdated TODOs and remove the selected/today badge text from the shift card UI. These changes consolidate parsing logic, improve today-shift mapping fidelity, and simplify the shift card display.
2026-03-17 12:14:14 -04:00
Achintha Isuru
376b4e4431 feat: Update API endpoint usage in repositories to remove redundant path property
- Refactored multiple repository implementations across client and staff features to directly use endpoint objects without accessing the `path` property.
- Introduced a new `FeatureGate` class for client-side feature gating based on user scopes, allowing for better access control to API endpoints.
- Added `ApiEndpoint` class to represent API endpoints with their paths and required scopes for future feature gating.
2026-03-17 12:01:06 -04:00
Achintha Isuru
57bba8ab4e Refactor API endpoint usage across multiple repositories to use ClientEndpoints and StaffEndpoints
- Updated ClientOrderQueryRepositoryImpl to replace V2ApiEndpoints with ClientEndpoints for vendor, role, hub, and manager retrieval methods.
- Modified ViewOrdersRepositoryImpl to utilize ClientEndpoints for order viewing, editing, and vendor retrieval.
- Refactored ReportsRepositoryImpl to switch from V2ApiEndpoints to ClientEndpoints for various report fetching methods.
- Changed SettingsRepositoryImpl to use AuthEndpoints for sign-out functionality.
- Adjusted AuthRepositoryImpl to replace V2ApiEndpoints with AuthEndpoints for phone authentication and sign-out processes.
- Updated ProfileSetupRepositoryImpl to utilize StaffEndpoints for profile setup.
- Refactored AvailabilityRepositoryImpl to switch from V2ApiEndpoints to StaffEndpoints for availability management.
- Changed ClockInRepositoryImpl to use StaffEndpoints for clock-in and clock-out functionalities.
- Updated HomeRepositoryImpl to replace V2ApiEndpoints with StaffEndpoints for dashboard and profile completion retrieval.
- Refactored PaymentsRepositoryImpl to utilize StaffEndpoints for payment summaries and history.
- Changed ProfileRepositoryImpl to switch from V2ApiEndpoints to StaffEndpoints for staff profile and section status retrieval.
- Updated CertificatesRepositoryImpl to use StaffEndpoints for certificate management.
- Refactored DocumentsRepositoryImpl to switch from V2ApiEndpoints to StaffEndpoints for document management.
- Changed TaxFormsRepositoryImpl to utilize StaffEndpoints for tax form management.
- Updated BankAccountRepositoryImpl to switch from V2ApiEndpoints to StaffEndpoints for bank account management.
- Refactored TimeCardRepositoryImpl to use StaffEndpoints for time card retrieval.
- Changed AttireRepositoryImpl to utilize StaffEndpoints for attire management.
- Updated EmergencyContactRepositoryImpl to switch from V2ApiEndpoints to StaffEndpoints for emergency contact management.
- Refactored ExperienceRepositoryImpl to use StaffEndpoints for industry and skill retrieval.
- Changed PersonalInfoRepositoryImpl to switch from V2ApiEndpoints to StaffEndpoints for personal information management.
- Updated FaqsRepositoryImpl to utilize StaffEndpoints for FAQs retrieval.
- Refactored PrivacySettingsRepositoryImpl to switch from V2ApiEndpoints to StaffEndpoints for privacy settings management.
- Changed ShiftsRepositoryImpl to use StaffEndpoints for shift management and retrieval.
- Updated StaffMainRepositoryImpl to switch from V2ApiEndpoints to StaffEndpoints for profile completion checks.
2026-03-17 11:40:15 -04:00
Achintha Isuru
31231c1e6d feat(api): refactor API endpoints to use structured ApiEndpoint class and introduce new endpoint files 2026-03-17 11:26:44 -04:00
Achintha Isuru
eccd2c6dbd Use UserRole enum for session role handling
Replace string-based role handling with a typed UserRole enum. Adds src/entities/enums/user_role.dart and exports it from krow_domain. Update SessionHandlerMixin to use List<UserRole> and change fetchUserRole to return UserRole?. V2SessionService now derives the role via UserRole.fromSessionData, and client/staff SessionListener widgets pass const <UserRole>[...] when initializing the auth listener. This centralizes role derivation and eliminates scattered role string literals.
2026-03-17 11:19:54 -04:00
Achintha Isuru
cc4e2664b6 feat(auth): enhance session management with proactive token refresh and error handling 2026-03-17 11:09:12 -04:00
Achintha Isuru
ba5bf8e1d7 refactor(session): migrate V2 session listener initialization to improve dependency injection and role handling 2026-03-17 10:55:18 -04:00
Achintha Isuru
b289ed3b02 feat(auth): add staff-specific sign-out endpoint and enhance session management 2026-03-17 10:21:57 -04:00
Achintha Isuru
4fca87bde1 Refactor auth repo imports; remove unused flag
Consolidate and reorder imports in the client authentication repository by moving the auth_repository_interface import to the top and removing the duplicate import. Also remove the unused UnauthorizedAppException reference from the imported symbols. In the staff authentication repository, drop the unused requiresProfileSetup variable (extracted from API response) and tidy up minor whitespace—removing dead code and silencing analyzer warnings.
2026-03-16 22:56:15 -04:00
Achintha Isuru
b31a615092 feat: Migrate staff profile features from Data Connect to V2 REST API
- Removed data_connect package from mobile pubspec.yaml.
- Added documentation for V2 profile migration status and QA findings.
- Implemented new session management with ClientSessionStore and StaffSessionStore.
- Created V2SessionService for handling user sessions via the V2 API.
- Developed use cases for cancelling late worker assignments and submitting worker reviews.
- Added arguments and use cases for payment chart retrieval and profile completion checks.
- Implemented repository interfaces and their implementations for staff main and profile features.
- Ensured proper error handling and validation in use cases.
2026-03-16 22:45:06 -04:00
Achintha Isuru
4834266986 feat: add entities for staff personal info, reports, shifts, and user sessions
- Implemented StaffPersonalInfo entity for staff profile data.
- Created ReportSummary entity for summarizing report metrics.
- Added SpendReport and SpendDataPoint entities for spend reporting.
- Introduced AssignedShift, CancelledShift, CompletedShift, OpenShift, PendingAssignment, ShiftDetail, TodayShift entities for shift management.
- Developed ClientSession and StaffSession entities for user session management.
2026-03-16 15:59:22 -04:00
Achintha Isuru
c0a7ca1329 Increase background geofence interval to 15m
Update BackgroundGeofenceService to register the periodic geofence task with a 15-minute interval instead of 10 seconds. This reduces frequent wakeups and resource usage and better matches typical platform background scheduling constraints.
2026-03-16 02:31:07 -04:00
Achintha Isuru
f4c56cf547 Update clock_in_bloc.dart 2026-03-16 02:25:55 -04:00
Achintha Isuru
31f03aa52a feat: Enhance clock-in feature with time window auto-refresh and lunch break data handling 2026-03-16 01:55:20 -04:00
Achintha Isuru
5fd2a44a8b feat: Add localization for hourly rate and enhance geofence notifications
- Added localization for hourly rate in English and Spanish.
- Updated background geofence service to use localized notification titles and bodies.
- Enhanced ClockInBloc to compute time window flags for check-in/check-out availability.
- Updated ClockInState and ClockInEvent to include check-in/check-out availability flags and messages.
- Refactored ClockInActionSection to display availability messages based on computed flags.
- Ensured compliance with design system for user-facing strings and notification messages.
2026-03-16 01:27:15 -04:00
Achintha Isuru
e02de1fb68 feat(clock_in): add early check-out banner and localization support 2026-03-14 20:36:35 -04:00
Achintha Isuru
f6de07fc25 refactor(clock_in): rename error handling variable for clarity in check-in interactions 2026-03-14 20:28:28 -04:00
Achintha Isuru
10bd61b250 feat(clock_in): add error handling support to check-in interactions 2026-03-14 20:21:10 -04:00
Achintha Isuru
e93f7f7004 fix(clock_in): improve error handling and state reset logic in clock-in process 2026-03-14 20:11:19 -04:00
Achintha Isuru
aa556c4a05 refactor(clock_in): reorganize validation logic into separate validator files 2026-03-14 20:03:30 -04:00
Achintha Isuru
28a219bbea Refactor clock-in feature: Introduce validation pipeline and interaction strategies
- Added a validation pipeline for clock-in actions, including geofence, time window, and override notes validators.
- Created a context class for passing validation data and results.
- Implemented check-in interaction strategies for swipe and NFC methods, encapsulating their UI and behavior.
- Removed redundant utility functions and centralized time formatting in a new utility file.
- Enhanced the notification service to handle clock-in and clock-out notifications separately.
- Updated the ClockInBloc to utilize the new validation and notification services.
- Cleaned up the ClockInActionSection widget to use the new interaction strategies and removed unnecessary listeners.
2026-03-14 19:58:43 -04:00
Achintha Isuru
e3f7e1ac3e fix(clock_in): restore early check-in banner logic for active shifts 2026-03-14 14:30:28 -04:00
Achintha Isuru
3478436227 refactor(clock_in): reorganize geofence and clock-in BLoC structure
- Deleted old geofence_event.dart and geofence_state.dart files.
- Created new geofence_event.dart and geofence_state.dart files under a dedicated geofence directory.
- Moved clock_in_bloc.dart, clock_in_event.dart, and clock_in_state.dart to a new clock_in directory for better organization.
- Updated import paths throughout the codebase to reflect the new structure.
- Implemented new ClockInBloc and GeofenceBloc classes to handle clock-in and geofence functionalities respectively.
- Enhanced event and state management for clock-in operations, including handling location verification and geofence checks.
2026-03-14 01:23:27 -04:00
Achintha Isuru
08a4326da4 feat: Add task execution callback registration to BackgroundTaskService and update geofence dispatcher to use it 2026-03-14 00:59:39 -04:00
Achintha Isuru
2889098f9f refactor: Replace debugPrint with print statements in background geofence dispatcher for logging 2026-03-14 00:45:18 -04:00
Achintha Isuru
8fcf1d9d98 feat: Enhance background geofence functionality with notifications and localization support 2026-03-13 21:44:39 -04:00
Achintha Isuru
6f57cae247 feat: Add overridden banner for geofence check with justification and update localization strings 2026-03-13 20:47:59 -04:00
Achintha Isuru
c92138a573 refactor: Improve code readability by formatting and restructuring Bloc context usage in ClockInActionSection 2026-03-13 20:44:45 -04:00
Achintha Isuru
1bbd306ca0 feat: Update geofence handling to allow checkout when checked in and show verified banner for overridden geofence 2026-03-13 20:43:51 -04:00
Achintha Isuru
ea078eaa02 refactor: Rearrange MultiBlocProvider and Scaffold structure in ClockInPage for improved readability 2026-03-13 17:15:44 -04:00