feat: Update architecture documentation for Data Connect Connectors pattern and remove unused import in staff connector repository implementation
This commit is contained in:
@@ -85,10 +85,18 @@ graph TD
|
||||
### 2.4 Data Connect (`apps/mobile/packages/data_connect`)
|
||||
- **Role**: Interface Adapter for Backend Access (Datasource Layer).
|
||||
- **Responsibilities**:
|
||||
- Implement Firebase Data Connect connector and service layer.
|
||||
- Map Domain Entities to/from Data Connect generated code.
|
||||
- Handle Firebase exceptions and map to domain failures.
|
||||
- Provide centralized `DataConnectService` with session management.
|
||||
- **Connectors**: Centralized repository implementations for each backend connector (see `03-data-connect-connectors-pattern.md`)
|
||||
- One connector per backend connector domain (staff, order, user, etc.)
|
||||
- Repository interfaces and use cases defined at domain level
|
||||
- Repository implementations query backend and map responses
|
||||
- Implement Firebase Data Connect connector and service layer
|
||||
- Map Domain Entities to/from Data Connect generated code
|
||||
- Handle Firebase exceptions and map to domain failures
|
||||
- Provide centralized `DataConnectService` with session management
|
||||
- **RESTRICTION**:
|
||||
- NO feature-specific logic. Connectors are domain-neutral and reusable.
|
||||
- All queries must follow Clean Architecture (domain → data layers)
|
||||
- See `03-data-connect-connectors-pattern.md` for detailed pattern documentation
|
||||
|
||||
### 2.5 Design System (`apps/mobile/packages/design_system`)
|
||||
- **Role**: Visual language and component library.
|
||||
@@ -195,3 +203,19 @@ Each app (`staff` and `client`) has different role requirements and session patt
|
||||
- **Session Store**: `ClientSessionStore` with `ClientSession(user: User, business: ClientBusinessSession?)`
|
||||
- **Lazy Loading**: `getUserSessionData()` fetches via `getBusinessById()` if session null
|
||||
- **Navigation**: On auth → `Modular.to.toClientHome()`, on unauth → `Modular.to.toInitialPage()`
|
||||
|
||||
## 7. Data Connect Connectors Pattern
|
||||
|
||||
See **`03-data-connect-connectors-pattern.md`** for comprehensive documentation on:
|
||||
- How connector repositories work
|
||||
- How to add queries to existing connectors
|
||||
- How to create new connectors
|
||||
- Integration patterns with features
|
||||
- Benefits and anti-patterns
|
||||
|
||||
**Quick Reference**:
|
||||
- All backend queries centralized in `apps/mobile/packages/data_connect/lib/src/connectors/`
|
||||
- One connector per backend connector domain (staff, order, user, etc.)
|
||||
- Each connector follows Clean Architecture (domain interfaces + data implementations)
|
||||
- Features use connector repositories through dependency injection
|
||||
- Results in zero query duplication and single source of truth
|
||||
|
||||
Reference in New Issue
Block a user