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.
This commit is contained in:
@@ -22,8 +22,8 @@ You are working within a Flutter monorepo (where features are organized into pac
|
||||
- **State Management**: Flutter BLoC/Cubit. BLoCs registered with `i.add()` (transient), never `i.addSingleton()`. `BlocProvider.value()` for shared BLoCs.
|
||||
- **DI & Routing**: Flutter Modular. Safe navigation via `safeNavigate()`, `safePush()`, `popSafe()`. Never `Navigator.push()` directly (except when popping a dialog).
|
||||
- **Error Handling**: `BlocErrorHandler` mixin with `_safeEmit()` to prevent StateError on disposed BLoCs.
|
||||
- **Backend**: Firebase Data Connect through `data_connect` package Connectors. `_service.run(() => connector.<query>().execute())` for auth/token management.
|
||||
- **Session Management**: `SessionHandlerMixin` + `SessionListener` widget.
|
||||
- **Backend**: V2 REST API via `ApiService` with `V2ApiEndpoints`. Domain entities have `fromJson`/`toJson`. Status fields use typed enums from `krow_domain`. Money values are `int` in cents.
|
||||
- **Session Management**: `V2SessionService` + `SessionHandlerMixin` + `SessionListener` widget. Session stores (`StaffSessionStore`, `ClientSessionStore`) in `core`.
|
||||
- **Localization**: Slang (`t.section.key`), not `context.strings`.
|
||||
- **Design System**: Tokens from `UiColors`, `UiTypography`, `UiConstants`. No hardcoded values.
|
||||
|
||||
@@ -55,7 +55,7 @@ Detect potential bugs including:
|
||||
- **API integration issues**: Missing error handling, incorrect data mapping, async issues
|
||||
- **Performance concerns**: Inefficient algorithms, unnecessary rebuilds, memory problems
|
||||
- **Security vulnerabilities**: Hardcoded credentials, insecure data storage, authentication gaps
|
||||
- **Architecture violations**: Features importing other features, business logic in BLoCs/widgets, Firebase packages outside `data_connect`
|
||||
- **Architecture violations**: Features importing other features, business logic in BLoCs/widgets, Firebase packages outside `core`, direct Dio usage instead of `ApiService`
|
||||
- **Data persistence issues**: Cache invalidation, concurrent access
|
||||
|
||||
## Analysis Methodology
|
||||
@@ -64,7 +64,7 @@ Detect potential bugs including:
|
||||
1. Map the feature's architecture and key screens
|
||||
2. Identify critical user flows and navigation paths
|
||||
3. Review state management implementation (BLoC states, events, transitions)
|
||||
4. Understand data models and API contracts via Data Connect connectors
|
||||
4. Understand data models and API contracts via V2 API endpoints
|
||||
5. Document assumptions and expected behaviors
|
||||
|
||||
### Phase 2: Use Case Extraction
|
||||
@@ -108,7 +108,7 @@ Analyze code for:
|
||||
- Missing error handling in `.then()` chains
|
||||
- Mounted checks missing in async callbacks
|
||||
- Race conditions in concurrent requests
|
||||
- Missing `_service.run()` wrapper for Data Connect calls
|
||||
- Missing `ApiErrorHandler.executeProtected()` wrapper for API calls
|
||||
|
||||
### Background Tasks & WorkManager
|
||||
When reviewing code that uses WorkManager or background task scheduling, check these edge cases:
|
||||
@@ -140,7 +140,9 @@ When reviewing code that uses WorkManager or background task scheduling, check t
|
||||
### Architecture Rules
|
||||
- Features importing other features directly
|
||||
- Business logic in BLoCs or widgets instead of Use Cases
|
||||
- Firebase packages used outside `data_connect` package
|
||||
- Firebase packages (`firebase_auth`) used outside `core` package
|
||||
- Direct Dio/HTTP usage instead of `ApiService` with `V2ApiEndpoints`
|
||||
- Importing deleted `krow_data_connect` package
|
||||
- `context.read<T>()` instead of `ReadContext(context).read<T>()`
|
||||
|
||||
## Output Format
|
||||
|
||||
Reference in New Issue
Block a user