106 Commits

Author SHA1 Message Date
39263a4af5 chore: fix 273+ analysis issues and repair corrupted core files 2026-03-20 21:05:23 +05:30
d3159bc2ae Merge branch 'origin/dev' into feature/session-persistence-new 2026-03-20 12:44:25 +05:30
Achintha Isuru
4cd83a9281 feat: Implement UTC conversion for order date and time serialization in order use cases 2026-03-19 23:34:29 -04:00
Achintha Isuru
9c71acb96a feat: Implement order details page and navigation for available orders 2026-03-19 14:08:34 -04:00
Achintha Isuru
96056d0170 feat: Implement available orders feature in staff marketplace
- Added `AvailableOrder` and `AvailableOrderSchedule` entities to represent available orders and their schedules.
- Introduced `GetAvailableOrdersUseCase` and `BookOrderUseCase` for fetching and booking orders.
- Created `AvailableOrdersBloc` to manage the state of available orders and handle booking actions.
- Developed UI components including `AvailableOrderCard` to display order details and booking options.
- Added necessary events and states for the BLoC architecture to support loading and booking orders.
- Integrated new enums and utility functions for handling order types and scheduling.
2026-03-19 13:23:28 -04:00
Achintha Isuru
5792aa6e98 feat: add UTC parsing utilities and update date handling across entities
- Introduced `utc_parser.dart` with functions to convert UTC timestamps to local time.
- Updated date parsing in various entities to use the new utility functions for consistency.
- Refactored date handling in `BenefitHistory`, `Business`, `AttendanceStatus`, `AssignedWorker`, `TimeRange`, `Invoice`, `PaymentChartPoint`, `StaffPayment`, `TimeCardEntry`, `OrderItem`, `OrderPreview`, `RecentOrder`, `StaffRating`, `CoverageDayPoint`, `ForecastWeek`, `NoShowIncident`, `SpendDataPoint`, `AssignedShift`, `CancelledShift`, `CompletedShift`, `OpenShift`, `PendingAssignment`, `Shift`, `ShiftDetail`, `TodayShift`, `BusinessMembership`, and `Staff`.
- Updated `ReorderWidget` and `OrderEditSheet` to handle date formatting correctly.
2026-03-19 13:00:17 -04:00
Achintha Isuru
eacf34999b Merge branch 'dev' into 595-sred-research-implement-cross-platform-nfc-clocking-interface-fe 2026-03-19 12:38:30 -04:00
zouantchaw
1d5c0e3b80 feat(api): add staff order booking contract and shift timeline alias 2026-03-19 16:07:25 +01:00
Achintha Isuru
493891eea0 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.
2026-03-19 10:53:37 -04:00
230942e776 dev merge 2026-03-19 15:25:37 +05:30
Achintha Isuru
843eec5692 feat: Refactor context reading in emergency contact and FAQs widgets
- Updated the context reading method in `EmergencyContactAddButton` and `EmergencyContactFormItem` to use `ReadContext`.
- Modified the `FaqsWidget` to utilize `ReadContext` for fetching FAQs.
- Adjusted the `PrivacySectionWidget` to read from `PrivacySecurityBloc` using `ReadContext`.

feat: Implement Firebase Auth isolation pattern

- Introduced `FirebaseAuthService` and `FirebaseAuthServiceImpl` to abstract Firebase Auth operations.
- Ensured features do not directly import `firebase_auth`, adhering to architecture rules.

feat: Create repository interfaces for billing and coverage

- Added `BillingRepositoryInterface` for billing-related operations.
- Created `CoverageRepositoryInterface` for coverage data access.

feat: Add use cases for order management

- Implemented use cases for fetching hubs, managers, and roles related to orders.
- Created `GetHubsUseCase`, `GetManagersByHubUseCase`, and `GetRolesByVendorUseCase`.

feat: Develop report use cases for client reports

- Added use cases for fetching various reports including coverage, daily operations, forecast, no-show, performance, and spend reports.
- Implemented `GetCoverageReportUseCase`, `GetDailyOpsReportUseCase`, `GetForecastReportUseCase`, `GetNoShowReportUseCase`, `GetPerformanceReportUseCase`, and `GetSpendReportUseCase`.

feat: Establish profile repository and use cases

- Created `ProfileRepositoryInterface` for staff profile data access.
- Implemented use cases for retrieving staff profile and section statuses: `GetStaffProfileUseCase` and `GetProfileSectionsUseCase`.
- Added `SignOutUseCase` for signing out the current user.
2026-03-19 01:10:27 -04:00
Achintha Isuru
9039aa63d6 feat: add benefit history feature with lazy loading and pagination
- Implemented `getBenefitsHistory` method in `HomeRepository` to retrieve paginated benefit history.
- Enhanced `BenefitsOverviewCubit` to manage loading and displaying benefit history.
- Created `BenefitHistoryPage` for full-screen display of benefit history with infinite scroll support.
- Added `BenefitHistoryPreview` widget for expandable history preview in benefit cards.
- Introduced `BenefitHistoryRow` to display individual history records.
- Updated `BenefitsOverviewState` to include history management fields.
- Added new entities and use cases for handling benefit history.
- Created design system documentation for UI patterns and known gaps.
2026-03-18 17:21:30 -04:00
Achintha Isuru
3a5f2cc9c6 feat(shifts): implement submit for approval functionality
- Added `submitForApproval` method to `ShiftsRepositoryInterface` and its implementation in `ShiftsRepositoryImpl`.
- Created `SubmitForApprovalUseCase` to handle the submission logic.
- Updated `ShiftsBloc` to handle `SubmitForApprovalEvent` and manage submission state.
- Enhanced `HistoryShiftsTab` and `MyShiftsTab` to support submission actions and display appropriate UI feedback.
- Refactored date utilities for better calendar management and filtering of past shifts.
- Improved UI components for better spacing and alignment.
- Localized success messages for shift submission actions.
2026-03-18 14:37:55 -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
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
e1d30c124b feat: migrate experience management to V2 API; add support for industries and skills 2026-03-17 13:44:48 -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
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
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
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
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
8fcf1d9d98 feat: Enhance background geofence functionality with notifications and localization support 2026-03-13 21:44:39 -04:00
Achintha Isuru
accff00155 feat: Enhance geofence functionality with new status banners and utility functions 2026-03-13 16:34:09 -04:00
Achintha Isuru
7b576c0ed4 feat: Implement notification and storage services, geofence management, and BLoC for geofence verification
- Add NotificationService for handling local notifications.
- Introduce StorageService for key-value storage using SharedPreferences.
- Create DeviceLocation model to represent geographic locations.
- Define LocationPermissionStatus enum for managing location permissions.
- Implement BackgroundGeofenceService for periodic geofence checks while clocked in.
- Develop GeofenceServiceImpl for geofence proximity verification using LocationService.
- Create GeofenceResult model to encapsulate geofence check results.
- Define GeofenceServiceInterface for geofence service abstraction.
- Implement GeofenceBloc to manage geofence verification and background tracking.
- Create events and states for GeofenceBloc to handle various geofence scenarios.
- Add GeofenceStatusBanner widget to display geofence verification status in the UI.
2026-03-13 16:01:26 -04:00
Achintha Isuru
316a148726 feat: Implement review order flow for one-time, recurring, and permanent orders
- Added ReviewOrderPage to handle order review before submission.
- Created ReviewOrderArguments model to pass data between pages.
- Implemented schedule sections for one-time, recurring, and permanent orders.
- Enhanced navigation flow to confirm order submission after review.
- Refactored order submission logic in OneTimeOrderPage, PermanentOrderPage, and RecurringOrderPage.
- Introduced utility functions for time parsing and scheduling.
- Created reusable widgets for displaying order information in the review section.
- Updated navigation methods to use popSafe for safer back navigation.
- Added MainActivity for Android platform integration.
2026-03-09 19:49:23 -04:00
Achintha Isuru
2484c6cff2 Refactor code structure for improved readability and maintainability 2026-03-09 16:26:53 -04:00
Achintha Isuru
7a5c130289 refactor: change singleton registrations to lazySingleton for improved performance 2026-03-09 15:01:18 -04:00
Achintha Isuru
8497709356 fix: Correct formatting and improve comments in various files for clarity 2026-03-02 12:38:57 -05:00
Achintha Isuru
26c4327ec5 refactor: reload billing data and update awaiting approval navigation to be awaitable. 2026-02-28 17:31:57 -05:00
Achintha Isuru
53b612851c refactor: enhance navigation robustness by introducing popSafe and safePushNamedAndRemoveUntil methods and updating their usage. 2026-02-28 17:23:53 -05:00
Achintha Isuru
c26128f1f2 feat: Enhance navigation robustness by redirecting to the appropriate home page on navigation errors or when popping the root route. 2026-02-28 17:02:44 -05:00
Achintha Isuru
76424b1b1f refactor: extract invoice approval and dispute logic into a dedicated ShiftCompletionReviewBloc. 2026-02-28 16:02:10 -05:00
Achintha Isuru
d609dd75fa Merge branch 'dev' into 493-implement-rapid-order-creation-voice-text-in-client-mobile-app 2026-02-27 15:32:11 -05:00
Achintha Isuru
c534584836 feat: Add certificate number field, update "Add Certificate" card UI with blur effect, and consolidate certificate view/upload actions. 2026-02-27 14:36:34 -05:00
Achintha Isuru
28cc0e3574 feat: Enable pre-filling document upload page with existing document URLs and update navigation method usage. 2026-02-27 13:35:04 -05:00
Achintha Isuru
e0d633d65d Merge branch '493-implement-rapid-order-creation-voice-text-in-client-mobile-app' into dev 2026-02-27 13:17:41 -05:00
Achintha Isuru
9d25fd44cc Add rapid order parsing & audio recording
Add support for transcribing and parsing rapid (urgent) orders into one-time order drafts. Introduces ParseRapidOrderTextToOrderUseCase and wiring for TranscribeRapidOrderUseCase, implements parseRapidOrder and transcribeRapidOrder in the client repository, and injects these into the RapidOrderBloc and module. Adds the record package dependency and registers the record plugin for iOS/macOS targets. Updates OneTimeOrder state, bloc and views to handle rapid-order drafts and navigate to the one-time order flow after parsing. Also includes small formatting and navigator changes.
2026-02-27 13:16:11 -05:00
Achintha Isuru
55a31661a1 feat: Implement audio recording and transcription for rapid order creation across platforms. 2026-02-27 11:49:17 -05:00
Achintha Isuru
52bdf48155 feat: Add RAPID order transcription and parsing services with associated response models and API endpoints. 2026-02-27 11:35:09 -05:00
Achintha Isuru
425bf19a9b feat: Implement full certificate management with upload, upsert, delete, and new domain models for staff certificates and their statuses. 2026-02-26 23:28:59 -05:00
Achintha Isuru
1aa5132abe feat: implement document upload functionality with dedicated UI, state management, and routing. 2026-02-26 16:11:24 -05:00
Achintha Isuru
b8d07380c0 replace the "Krow" with "KROW" 2026-02-26 15:13:26 -05:00
Achintha Isuru
083744cd34 feat: Implement attire item filtering and refactor attire capture flow and repository logic 2026-02-25 22:18:25 -05:00