# Data Model: Bottom Navigation with Chat Entry

## Entities

### Store
- **Fields**: `id` (string, required), `name` (string, required), `status` (enum: active/inactive/unavailable), `userHasAccess` (bool), `isSelected` (bool derived), `lastUpdated` (DateTime optional).
- **Validation**: `id` and `name` non-empty; `status` must be one of allowed enums; `isSelected` true for only one store at a time.
- **Relationships**: Referenced by `UserContext.currentStore`.
- **State transitions**: `isSelected` toggled when user confirms a switch; `status` may change based on backend data refresh.

### UserContext
- **Fields**: `userId` (string), `role` (enum/permissions), `currentStore` (Store?), `hasMultipleStores` (bool), `isAuthenticated` (bool).
- **Validation**: `isAuthenticated` true before bottom nav is shown; `currentStore` required for store-scoped screens; `hasMultipleStores` derives from store list length.
- **Relationships**: Owns `currentStore` reference; informs navigation guards for Store tab visibility and switching.
- **State transitions**: Updates `currentStore` after successful store switch; resets if auth/session clears (e.g., 403 handling).

### NavigationTabState
- **Fields**: `activeTab` (enum: home/store/chat/settings), `tabStacks` (map tab -> last route/scroll state), `isBottomNavVisible` (bool).
- **Validation**: `activeTab` must be one of defined tabs; bottom nav hidden for onboarding/full-screen flows.
- **Relationships**: Drives presentation layer (bottom bar active states) and interacts with GoRouter for tab routes.
- **State transitions**: `activeTab` changes on user tap; `tabStacks` updated when routes within a tab change; nav visibility toggled by guardable flows.

### ChatPlaceholderState
- **Fields**: `availabilityMessage` (string), `isOffline` (bool), `canAttempt` (bool), `lastAttempt` (DateTime?).
- **Validation**: Message must be present; offline flag reflects connectivity; `canAttempt` indicates if UI should show retries or guidance.
- **Relationships**: Scoped to Chat tab; independent of store selection.
- **State transitions**: Updates message based on connectivity or backend readiness; resets when leaving Chat tab if needed.
