3.8 KiB
3.8 KiB
Architecture Reviewer Memory
Project Structure Confirmed
- Feature packages:
apps/mobile/packages/features/<app>/<feature>/ - Domain:
apps/mobile/packages/domain/ - Design system:
apps/mobile/packages/design_system/ - Core:
apps/mobile/packages/core/ - Data Connect:
apps/mobile/packages/data_connect/ client_orders_commonis atapps/mobile/packages/features/client/orders/orders_common/(shared across order features)
BLoC Registration Pattern
- BLoCs registered with
i.add<>()(transient) per CLAUDE.md -- NOT singletons - This means
BlocProvider(create:)is CORRECT (notBlocProvider.value()) SafeBlocmixin exists in core alongsideBlocErrorHandler
Known Pre-existing Issues (create_order feature)
- All 3 order BLoCs make direct
_service.connectorcalls for loading vendors, hubs, roles, and managers instead of going through use cases/repositories (CRITICAL per rules, but pre-existing) firebase_data_connectandfirebase_authare listed as direct dependencies inclient_create_order/pubspec.yaml(should only be indata_connectpackage)- All 3 order pages use
Modular.to.pop()instead ofModular.to.popSafe()for the back button
Known Staff App Issues (full scan 2026-03-19)
- recurring_violations.md - Detailed violation patterns
Critical
- ProfileCubit calls repository directly (no use cases, no interface)
- BenefitsOverviewCubit calls repository.getDashboard() directly (bypasses use case)
- StaffMainCubit missing BlocErrorHandler mixin
- firebase_auth imported directly in auth feature repos (2 files)
High (Widespread)
- 53 instances of
context.read<>()withoutReadContext()wrapper - ~20 hardcoded Color(0x...) values in home/benefits widgets
- 5 custom TextStyle() in faqs_widget and tax_forms
- 8 copyWith(fontSize:) overrides on UiTypography
- ~40 hardcoded SizedBox spacing values
- Hardcoded nav labels in staff_nav_items_config.dart
- Zero test files across entire staff feature tree
Design System Tokens
- Colors:
UiColors.* - Typography:
UiTypography.* - Spacing:
UiConstants.space*(e.g.,space3,space4,space6) - App bar:
UiAppBar
Known Client App Issues (full scan 2026-03-19)
Critical
- Reports feature: All 7 report BLoCs call ReportsRepository directly (no use cases)
- OneTimeOrderBloc, PermanentOrderBloc, RecurringOrderBloc call _queryRepository directly for loading vendors/hubs/roles
- OneTimeOrderBloc._onSubmitted has payload building business logic (should be in use case)
- ClientMainCubit missing BlocErrorHandler mixin
- firebase_auth imported directly in authentication and settings feature repos (2 packages)
High (Widespread)
- 17 hardcoded Color(0x...) across reports, coverage, billing, hubs
- 11 Material Colors.* usage (coverage, billing, reports)
- 66 standalone TextStyle() (almost all in reports feature)
- ~145 hardcoded EdgeInsets spacing values
- ~97 hardcoded SizedBox dimensions
- ~42 hardcoded BorderRadius.circular values
- 6 unsafe Modular.to.pop() calls (settings, hubs)
- BlocProvider(create:) used in no_show_report_page for Modular.get singleton
- Zero test files across entire client feature tree
- 2 hardcoded user-facing strings ("Export coming soon")
- 9 files with blanket ignore_for_file directives (reports feature)
Naming Convention Violations
- CoverageRepository, BillingRepository, ReportsRepository missing "Interface" suffix
- IViewOrdersRepository uses "I" prefix instead of "Interface" suffix
Review Patterns (grep-based checks)
Color(0xfor hardcoded colorsTextStyle(for custom text stylesNavigator.for direct navigator usageimport.*features/for cross-feature imports (must be zero)_service.connectorin BLoC files for direct data connect callsModular.to.pop()for unsafe navigation (should bepopSafe())